My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 4: Selected Tabs, Glider feature request
4 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by greg.r.hemphill, Jun 28, 2007
I created tabs for jumping to each section in the glider squence.  However I'm having trouble 
figuring out how to change the CSS class of the tab for the currently displaying section, so that I can 
make it look "selected" and have it automaticly change which tab is selected when glider rotates to 
the next section.  The CSS class should also change when the tab is clicked on.
Comment 1 by canskie, Jul 05, 2007
i just needed the same
here`s my diff
glider.diff
2.2 KB   Download
Comment 2 by claudio.simeone, Sep 23, 2007
nice work!
Comment 3 by bruno.bornsztein, Sep 28, 2007
The latest version in SVN adds an active class for the current tab.
Comment 4 by neupix, Oct 02, 2007
when autoGlide is turned on, the tabs are not being set as active. Is there any quick
way to fix this?
Comment 5 by h...@inneractive.nl, Apr 01, 2008
this is exactly what i searching for, but my knowledge is to less to implement the 
glider.diff :(

Could anyone help me to make this work?? See attachment! I just need the tabs to be 
selected when current section is shown, if possible also switch tabs when you use 
the "next" / "previous".

Thanx a lot!!
example.zip
32.2 KB   Download
Comment 6 by ingeofm, May 02, 2009
Hi,

I couldn't make it work with any of the other scripts, so I took an idea from another
script posted here (I can't actually remember which one), is done between the movoTo
function, but the final code looks like this:

moveTo: function(element, container, options){
			this.current = $(element);
			var a_section = 'a_' + this.current.id;
			//$(a_section).addClassName('control_activo');
			var controls = this.wrapper.getElementsBySelector('div.controls a');

			controls.each(function(control){
				var control_id = 'a_' + control.href.split("#")[1];
				var element_id = 'a_' + element.id;
				//alert('control_id: ' + control_id + ' / element_id: ' + element_id);
				if (control_id == element_id) {
					control.addClassName("control_activo")
				}
				else {
					control.removeClassName("control_activo")
				}
			});

			Position.prepare(); ...


Comment 8 by sarahmster, Jun 04, 2009
For those using version 0.0.4 (latest SVN version), which supports "highlighting" the
active tab, you may encounter an error in Internet Explorer (but not Firefox, Safari,
Chrome or Opera) when you click on a tab: "object doesn't support this action", and
the usual line reference for the problem is 45 (or thereabouts).  If you have
debugging turned off, you may not be aware of the error, but when you click on the
tab, the top of the glider will jump to the top of your browser window instead of
scrolling only the glider contents.

To fix this problem, replace "moveTo" with "moveToHere" (or something else of your
choice that is unique) in the code in 2 places, as shown below.

Original Lines 40-47:
  click: function(event) {
		this.stop();
    var element = Event.findElement(event, 'a');
    if (this.scrolling) this.scrolling.cancel();
    
	moveTo = this.wrapper.down('#'+element.href.split("#")[1])
    this.moveTo(moveTo, this.scroller, { duration:this.options.duration });     
    Event.stop(event);

Revise to this:

  click: function(event) {
		this.stop();
    var element = Event.findElement(event, 'a');
    if (this.scrolling) this.scrolling.cancel();
    
	moveToHere = this.wrapper.down('#'+element.href.split("#")[1])
    this.moveTo(moveToHere, this.scroller, { duration:this.options.duration });     
    Event.stop(event);

Hope this helps someone, as it took me a good while to figure it out.  (BTW, I am NOT
using autoGlide).
Comment 10 by comprepairgurus, Nov 05, 2009
The fix above resolved lots of issues I was running into with both IE7 and Firefox.
After implementing the above fix, I ran into the issue of active link states not
showing up. Drop in the code below, and you should be set. Around lines 61 and 62.
Between moveTo, and Position.prepare, as seen below. Hope this helps.


	moveTo: function(element, container, options){
			this.current = $(element);
			
			$$('#my-glider div.controls a.active').invoke('removeClassName', 'active');
			$($(element).controllerID).addClassName('active');

			Position.prepare();
	    var containerOffset = Position.cumulativeOffset(container),
	     elementOffset = Position.cumulativeOffset($(element));


Sign in to add a comment

Hosted by Google Code