Using pseudo-frame jQuery (advanced version)


You had to create pseudo-before frame (frame-like pages, Cssframe), and without a frame style sheets (CSS) and JavaScript library jQuery Here is how to achieve using.

This is a version of its additional functions.
The basic frame using pseudo jQuery is a basic description. Please see from there first.

This official added features are as follows.


The following files and accompanies a brief tutorial.
For more information, please see the comments in the script file.

  1. Download
  2. On the menu resize
  3. Pseudo-frame for switching
  4. For print-only screen

Download


_^_

On the menu resize

Mouse over the right part of menu (when the vertical scroll bar, the left side) is added to the area where you can drag.

$(CSF.resizerId).resizable({
handles: "e",
autoHide: true,
alsoResize : CSF.menuId,
resize: function(){//Content in the resize operation
//get the inside dimension of the browser
CSF.browserWidth = $('body').outerWidth(true);
CSF.browserHeight = $('body').outerHeight(true);
//get the "menu" width when this function is called because it can be resized.
CSF.menuWidth = $(CSF.menuId).outerWidth(true);
//change the width of "main" element, and its left position.
$(CSF.mainId).width(CSF.browserWidth-CSF.menuWidth).css("left",CSF.menuWidth);
}
});

_^_

Pseudo-frame for switching

Added ability to switch between the validity of the pseudo-frame.
Adds the given ID to enable or disable the click event.

However, Internet Explorer (IE) is to become an illegal move, rather than switching, dynamic ways to adopt a combination of cookies and re-read screen.
For more information, please see the comments written there with a script file.

"CSF.csfRemoverId" disabled event set in the element with an ID, "CSF.csfStarterId" set in the event ID is set with the elements activated.

$(CSF.csfRemoverId).click(function(){
if($(CSF.targetRisizeBar).size() > 0){
//IE6-8 behaves improperly so in IE this function sets required values to the cookie and figures a screen again.
var exp = new Date();
exp.setMonth(exp.getMonth() + 2);
CSF.setCookie('csf', '0', exp, undefined, undefined);
if(jQuery.support.opacity){
$(CSF.resizerId).resizable('destroy').removeAttr('style');
$(CSF.headerId).removeAttr('style');
$(CSF.mainId).removeAttr('style');
$(CSF.footerId).removeAttr('style');
$(CSF.menuId).removeAttr('style');
$(CSF.targetRisizeBar).remove();
$('body').removeAttr('style');
$('html').removeAttr('style');
if (typeof removeFunc == 'function'){
removeFunc();
}
$(this).unbind();
} else {
location.reload();
}
}
});

$(CSF.csfStarterId).click(function(){
if($(CSF.targetRisizeBar).size() < 1){
var exp = new Date();
exp.setMonth(exp.getMonth() + 2);
CSF.setCookie('csf', '1', exp, undefined, undefined);
CSF.main(restartFunc,removeFunc);
if (typeof restartFunc == 'function'){
restartFunc();
}
}
});

_^_

For print-only screen

If you try to print without a frame pseudo-screen collapses.
Printable outputs (rather than outputs a pseudo-frame screen temporarily disabled, but ...) automatically generates links.

"CSF.csfPrintCls" output is set by the element with the class.
For example, "<span class="cframe-print"> Print Page </span>" and so on.

if ($(CSF.csfPrintCls).size() > 0){
var printString = $(CSF.csfPrintCls).html();
if(!(printString)){
printString = 'Print Page';
}
if (location.search){
$(CSF.csfPrintCls).html( '<a href="' + location.pathname + location.search + '&cflame=print" target="_blank">' + printString + '</a>' );
}else{
$(CSF.csfPrintCls).html( '<a href="' + location.pathname + '?cflame=print" target="_blank">' + printString + '</a>' );
}
}

As an example that actually works, the pseudo-sample frame (http://labo.ek-pro.com/exp/2011-05-01/csf-rich/) Please refer to.

Tags: JavaScript


HOME > Articles of the year two thousand and eleven > pseudo-frame using jQuery (advanced version)

HOMEHOME CategoryCategory HistoryHistory

Site Search :

[HTML link code]