When I use the Views Cycle and I add a pager all works fine. But there is one issue;

on the initial page load, no pagers are active. After the second slide is loaded, all works fine.

After some JS debugging I found out that on the first call options.SlideNum in Drupal.viewsSlideshowPagerFields.transitionBegin has a value of 2, and I have 2 slides.

After that, the number toggles between 0 and 1.

Any thoughts?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Marty2081’s picture

I work on the same project as Baris. If we disable the option " Start On Last Slide Viewed" the pager of the first slide correctly gets a class "active" on page load. So the issue must be somewhere in there.

pandabrand’s picture

I am having this issue as well but it's not related to the "Start On Last Slide Viewed" option. For me it's tied to using advanced options when I add more than one advanced option,(I am using the before and after option) the active class stops appearing. I don't know how or if this is tied to this in any way but on the JS where the option are displayed it looks like this.

"viewsSlideshowCycle":{
	"#views_slideshow_cycle_main_es_media-block_es_media":{
		"num_divs":5,
		"id_prefix":"#views_slideshow_cycle_main_",
		"div_prefix":"#views_slideshow_cycle_div_",
		"vss_id":"es_media-block_es_media",
		"effect":"scrollLeft",
		"transition_advanced":1,
		"timeout":0,
		"speed":750,
		"delay":0,
		"sync":1,
		"random":0,
		"pause":1,
		"pause_on_click":0,
		"action_advanced":1,
		"start_paused":1,
		"remember_slide":0,
		"remember_slide_days":1,
		"pause_when_hidden":1,
		"pause_when_hidden_type":"full",
		"amount_allowed_visible":"",
		"nowrap":0,
		"fixed_height":1,
		"items_per_slide":1,
		"wait_for_image_load":1,
		"wait_for_image_load_timeout":3000,
		"cleartype":1,
		"cleartypenobg":0,
		"advanced_options":"{\"after\":\"if(jQuery('object[id^=swftools-]').is(':visible')) {var objid = jQuery('object[id^=swftools-]').attr('id');swftools.getObject(objid).sendEvent('PLAY','true');}\\n\",\"before\":\"before:function() {if(jQuery('object[id^=swftools-]').is(':visible')) {var objid = jQuery('object[id^=swftools-]').attr('id');swftools.getObject(objid).sendEvent('STOP');}}\\n\"}",
		"advanced_options_choices":"before",
		"advanced_options_entry":"if(jQuery('object[id^=swftools-]').is(':visible')) {var objid = jQuery('object[id^=swftools-]').attr('id');swftools.getObject(objid).sendEvent('STOP');}"}
	}
}

when i only have one option the advanced_option_choices and advanced_options_entry are both empty and active class works when I add a second,(doesn't matter if it's before or after) it will end up in those two and the active class goes away. Maybe it's correlation but it happens consistently for me. Anybody know what's happening there?

pandabrand’s picture

Actually it seems to be with the 'before' portion of advanced options, it works fine with 'after' but not before and i can't see what is wrong with it and it's really screwing up my site, I kind of need this to work. anyone?

MustangGB’s picture

Title: First slide misses class 'active' on page load » First pager misses class 'active' on page load
FileSize
1.23 KB

Super annoying bug, I'd say this is a major priority

MustangGB’s picture

Title: First pager misses class 'active' on page load » First slide misses class 'active' on page load
Priority: Normal » Major
Status: Active » Needs review

Clarifying issue

Geijutsuka’s picture

Title: First pager misses class 'active' on page load » First slide misses class 'active' on page load

I'm having the same issue at http://thinktank.arizona.edu/testing-page-2 (will try #4 patch asap)
Except in my case, the .active class doesn't get applied when I tell the slideshow to start with a random slide (done by showing the "View Transition Advanced Options" and checking the Random box or adding "random = true" in the "jQuery Cycle Custom Options" section).

Geijutsuka’s picture

Status: Needs review » Needs work

I applied the patch to a new install of 7.x-3.x-dev and the latest D7. It still looks as if the active class isn't getting applied to the correct initial slide.

MustangGB’s picture

Can you give the steps to reproduce?

Geijutsuka’s picture

I followed this tutorial to set up the show with an image pager:
http://www.brightwebsitedesign.com/how-to-install-views-slideshow-module...
The only difference is that I checked the Random box under View Transition Advanced Options.

MustangGB’s picture

Status: Needs work » Needs review
FileSize
1.48 KB

Here is an updated version that fixes the pager active class for the first slide when random order is in use.
I have a feeling it needs jquery.cycle.all.js version 2.9999 or later, however I used version 2.9999.5 for my testing.

Geijutsuka’s picture

Status: Needs review » Fixed

The patch works like a charm! Just like you said though, use jQuery Cycle 2.9999 or later. Mine is working on jQuery 2.9999.5.

MustangGB’s picture

Status: Fixed » Reviewed & tested by the community

Have you committed this to the git repository?
If not, then you should instead use RTBC

Geijutsuka’s picture

Sorry about that akamustang. Thank you for clarifying the status (I'm not quite sure how to commit to the git repository...).

MustangGB’s picture

That is for a module maintainer to do.

TimG1’s picture

Another confirmation. #10 worked for me. Patched on 7.x-3.x-dev (2012-Apr-25)

-Tim

wangqizhong’s picture

Thanks a lot to BarisW, akamustang and everyone else for the great work on the patches, testing, reviews and reporting.

It's more time this got committed and I went ahead and had this rolled at:

7.x-3.x: 5528a45

Marking this as fixed.

Please let me know if you would have any other questions, comments, issues or concerns on any of these changes, I would be glad to provide more information.
Thanks again to everyone for the help and great work on this issue.

Cheers!

wangqizhong’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.