You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

How to get jQuery parent for which scrollable onSeek event is called? Created Sep 22, 2009

This thread is solved

Views: 968     Replies: 7     Last reply Sep 23, 2009  
You must login first before you can use this feature

ajay

Posts: 6

Registered:
Sep 22, 2009

How to get jQuery parent for which scrollable onSeek event is called?

Posted: Sep 22, 2009

I have multiple tabs initialised through single statement like below.

$("div.scrollable").scrollable({
vertical:true,
size: 3 ,
onSeek: function(event, i) {

//different param to be passed based on which scrollable it is called for
somefunc(param);

}
);

Can it be done? Can I get the div id of the scrollable for which onSeek is called?

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1838

Registered:
Nov 16, 2007

» How to get jQuery parent for which scrollable onSeek event is called?

Posted: Sep 22, 2009

Reply to: How to get jQuery parent for which scrollable onSeek event is called?, from ajay

onSeek: function(e, i) {
  var root = this.getRoot();
  var parent = root.parent();
}

ajay

Posts: 6

Registered:
Sep 22, 2009

» » How to get jQuery parent for which scrollable onSeek event is called?

Posted: Sep 22, 2009

Reply to: » How to get jQuery parent for which scrollable onSeek event is called?, from tipiirai
Awesome....

one more problem...

I have multiple scrollables as below...


<div id="main1">
	<div id="s1" class="scrollable">
		<div class="items">
			<div class="item">
			</div>
			<div class="item">
			</div>
			<div class="item">
			</div>
		</div>
	</div>
</div>
<div id="main2">
	<div id="s2" class="scrollable">
		<div class="items">
			<div class="item">
			</div>
			<div class="item">
			</div>
			<div class="item">
			</div>
		</div>
	</div>
</div>

It's initialising the scrollables with incorrect item size.
For both scrollable, the size comes out to be sum of both...
So if s1 has 5 items and s2 has 3 items, both scrollables show the scroll bars as if both have 8 items...Navigating at the end of items does not correctly reflect in the scrollbar...

Do I need to initialise all scrollables differently giving them different class and ids?

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1838

Registered:
Nov 16, 2007

» » » How to get jQuery parent for which scrollable onSeek event is called?

Posted: Sep 23, 2009

Reply to: » » How to get jQuery parent for which scrollable onSeek event is called?, from ajay
you should be able to initialize your scrollables with a single call like this:


// replace size configuration variable to anything you like
$(".scrollable").scrollable({size: 1});

see more information:

http://flowplayer.org/tools/scrollable.html#multiple

ajay

Posts: 6

Registered:
Sep 22, 2009

» » » » How to get jQuery parent for which scrollable onSeek event is called?

Posted: Sep 23, 2009

Reply to: » » » How to get jQuery parent for which scrollable onSeek event is called?, from tipiirai
I have initialised through a single call only... but as I mentioned each scrollable shows scrollbar as if total items in the scrollable are sum of all items in different scrollables...
Not sure if some bug in the library..I have checked many times and everything seems correct...

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1838

Registered:
Nov 16, 2007

» » » » » How to get jQuery parent for which scrollable onSeek event is called?

Posted: Sep 23, 2009

Reply to: » » » » How to get jQuery parent for which scrollable onSeek event is called?, from ajay
do you have a demo page online?

ajay

Posts: 6

Registered:
Sep 22, 2009

» » » » » » How to get jQuery parent for which scrollable onSeek event is called?

Posted: Sep 23, 2009

Reply to: » » » » » How to get jQuery parent for which scrollable onSeek event is called?, from tipiirai
ok issue resolved...

removed the css defs below and it worked fine...
I guess earlier it was setting the height as fixed irrespective of number of items in the scrollable...

/* root element for scrollable items */
div.scrollable div.items {
position:absolute;

/* this time we have very large space for the height */
height:20000em;
}

ajay

Posts: 6

Registered:
Sep 22, 2009

» » » » » » How to get jQuery parent for which scrollable onSeek event is called?

Posted: Sep 23, 2009

Reply to: » » » » » How to get jQuery parent for which scrollable onSeek event is called?, from tipiirai
Now that scrollbars are correctly displaying/working, mousewheel stopped working...
$("div.scrollable").scrollable({vertical:true,
size: 3
}).mousewheel();
If i undo the removed section in css, mousewheel starts working again... Strange..
Can anyone explain why the position and height set for items and scrollable as above?

Thanks in advance..