swipebox icon indicating copy to clipboard operation
swipebox copied to clipboard

Swipe box doesn't work with jQuery 3.2.1

Open icekem opened this issue 7 years ago • 10 comments

Swipe box doesn't work with jQuery 3.2.1.

When you click any space on page black screen opens. Can you fix it?

icekem avatar Jan 13 '18 08:01 icekem

I think

selector = elem.selector,

just needs to be replaced with:

selector = '.swipeboxImg',

all and the .bind()'s to be changed to .on and unbind() to .off()

shawnCaza avatar Jan 30 '18 22:01 shawnCaza

Yes it works, but some time ppl may use different class names eg selector = '.swipebox',

shandhiviyarajan avatar Feb 12 '18 07:02 shandhiviyarajan

Yes, that would be an issue. Do you know where custom class names are set?

shawnCaza avatar Feb 12 '18 17:02 shawnCaza

Normally when the .swipebox is called.

For example in mine it is $('.swipebox').swipebox({options});

I did a console.log in the jQuery file, and it gets the elements, but the elem.selector does not work.

I found this on the jQuery upgrade site, https://jquery.com/upgrade-guide/3.0/#breaking-change-deprecated-context-and-selector-properties-removed

woodsba avatar Mar 08 '18 16:03 woodsba

The solution of @shandhiviyarajan worked for me.

zuera avatar Mar 15 '18 19:03 zuera

Yes that works in that one instance, but What if you have different selectors to trigger it with different options, like you want one swipebox on your page looping, and another not.

woodsba avatar Mar 15 '18 19:03 woodsba

Does anybody have a working update that they would be willing to post?

risingisland avatar Apr 21 '18 11:04 risingisland

Here's a patch file we've been using internally to make Swipebox work for us. I think this should work regardless of the selector, but let me know if you see any issues with it.

swipebox-selector-fix.patch.txt

bmcclure avatar Jun 07 '18 17:06 bmcclure

Actually, this PR is an even better fix I think: https://github.com/brutaldesign/swipebox/pull/298

bmcclure avatar Jun 07 '18 17:06 bmcclure

Here's a patch file we've been using internally to make Swipebox work for us. I think this should work regardless of the selector, but let me know if you see any issues with it.

swipebox-selector-fix.patch.txt

bmcclure! thanks a LOT... I tried the first suggestion, by shawnCaza, and it didn't work, I could click on the picture already, but that would only cause the referenced image to be downloaded (shown) directly, by its URL

the patch, however, works perfectly... I've never seen a patch file like this before, totally love it! :)

thanks a lot @ 02.22.2020

peterjosvai avatar Feb 22 '20 18:02 peterjosvai