Sequence icon indicating copy to clipboard operation
Sequence copied to clipboard

hash is undefined when using hashDataAttribute: true

Open prashantsani opened this issue 10 years ago • 5 comments

Hello. I m using following options for the slider; var options = { navigationSkip: false, hashTags:true, hashDataAttribute:true, hashChangesOnFirstFrame:true };

i have used all the three options hashTags, hashDataAttribute and hashChangesOnFirstFrame as true. I have included the hashChange event plugin (http://benalman.com/projects/jquery-hashchange-plugin/ ) Also i have added a data-sequence-hashtag attribute as follows:

<li class="animate-in" data-sequence-hashtag="hash1">
........
</li>

but the hash in url is always undefined.

Example URL : http://prashantsani.com/demos/misc/sequence/

prashantsani avatar Feb 02 '15 09:02 prashantsani

This error appears in the console:

$.browser is undefined

I believe this is being caused by the jQuery hashchange plugin and your use of jQuery 1.9.1. $.browser was removed from jQuery 1.9+ so you'll either need to look for an updated version of hashchange that works with jQuery 1.9 or downgrade jQuery to anything below 1.9.

IanLunn avatar Feb 02 '15 09:02 IanLunn

Thanks for the update. But when I m using this plugin, https://github.com/gabceb/jquery-browser-plugin (which kinda solves $.browser issue, still the #hash is undefined.

is there any otherway I can have the #hash thing? Thanks.

prashantsani avatar Feb 02 '15 10:02 prashantsani

This is a bug with hashDataAttribute, possibly an update to the jQuery library has made the way Sequence gets data attributes obsolete.

Instead of using hashDataAttribute and data attributes, please set hashDataAttribute to false and use IDs to specify a hashtag instead.

I believe the fix for this is changing all instances of:

.prop(self.getHashTagFrom);

To:

.data("sequence-hashtag");

IanLunn avatar Feb 03 '15 15:02 IanLunn

Hey. I replaced following .prop(self.getHashTagFrom);

To: .data("sequence-hashtag"); (as you said) It works now. Can we have a another library used instead of hashChange for future update? as hashChange isnt updated and we have to rely on $.browser jQuery plugin.

Bdw, a big fan of sequence.js Have been using and following sequence.js since its inception long time ago. Havent faced any issues yet, amazing library :)

Thanks

prashantsani avatar Feb 03 '15 17:02 prashantsani

Sequence v2 (check out the early build here) works without a dependency for hash functionality, so this is coming.

Glad you like Sequence, I'll be looking for feedback on v2 soon so maybe you're up for it!

IanLunn avatar Feb 03 '15 18:02 IanLunn