Hi,

This line:

$('body>.jScrollPaneContainer').css({'height': $w.height() + 'px', 
'width': $w.width() + 'px'});

translates to:

"Set the height and width of the element with a class of 
jScrollPaneContainer directly inside the body (e.g. not nested any 
deeper) to the height and width of the window."

The "body>" bit makes sure that any other scrollPane's on your page 
which are nested deeper don't also get their height and width changed.

Hope that helps,

Kelvin :)

simplybrianp wrote:
> In looking at the code for the full body scroll. I can not seem to
> understand one part of it. I am actually doing a couple of scroll
> panes in a page, that resize based on the window size, and am using
> the full body scroll as an example. I can not figure out what is going
> on in the line with the *** in front of it. Does anyone know what this
> is doing? Or how I would us it on a named div?
> 
> $(function()
>                       {
>                               // this initialises the demo scollpanes on the 
> page.
>                               $('#pane3').jScrollPane();
>                               $('#pane1, #pane2').jScrollPane();
> 
>                               var isResizing;
> 
>                               // and the body scrollpane
>                               var setContainerHeight = function()
>                               {
>                                       // IE triggers the onResize event 
> internally when you do the
> stuff in this function
>                                       // so make sure we don't enter an 
> infinite loop and crash the
> browser
>                                       if (!isResizing) {
>                                               isResizing = true;
>                                               $w = $(window);
>                                               $c = $('#container');
>                                               var p = 
> (parseInt($c.css('paddingLeft')) || 0) +
> (parseInt($c.css('paddingRight')) || 0);
>                                               
> ***$('body>.jScrollPaneContainer').css({'height': $w.height() +
> 'px', 'width': $w.width() + 'px'});
>                                               $c.css({'height': 
> ($w.height()-p) + 'px', 'width': ($w.width() -
> p) + 'px', 'overflow':'auto'});
>                                               $c.jScrollPane();
>                                               isResizing = false;
>                                       }
>                               }
>                               $(window).bind('resize', setContainerHeight);
>                               setContainerHeight();
> 
>                               // it seems like you need to call this twice to 
> get consistantly
> correct results cross browser...
>                               setContainerHeight();
> 
>                       });
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery (English)" group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to