Closing on Mobile
-
Hey,
I really appreciate the simplicity of your plugin, however the boxes won’t close on mobile. This issue has already been addressed here: https://www.ads-software.com/support/topic/usability-on-ipad/
Since it wasn’t fixed I thought you might not have the time to do so. To fix this, just use the following code:
/* mysticky blocks animation */ $('.mysticky-block-left .mysticky-block-icon').click(function(){ $(this).toggleClass("mse-open"); if ($(this).hasClass("mse-open")) { $(this).parent().stop().animate({'left' : '0px'}); } else { var x = $(this).parent().width(); $(this).parent().stop().animate({'left': 0 - x}); } }); $('.mysticky-block-left .mysticky-block-content').mouseleave(function(){ var x = $(this).parent().width(); $(this).parent().stop().animate({'left': 0 - x}); }); $('.mysticky-block-right .mysticky-block-icon').click(function(){ $(this).toggleClass("mse-open"); if ($(this).hasClass("mse-open")) { $(this).parent().stop().animate({'right' : '0px'}); } else { var y = $(this).parent().width(); $(this).parent().stop().animate({'right' : 0 - y}); } }); $('.mysticky-block-right .mysticky-block-content').mouseleave(function(e){ var y = $(this).parent().width(); $(this).parent().stop().animate({'right' : 0 - y}); });
Edit: The file is mystickyelements.js, you have to overwrite the respective code.
Edit2: What this actually does is that when someone clicks on the icon box while it is open, it will close again instead of doing nothing. One might improve this by making it close when someone clicks anywhere other than the icon box, but this solution is good enough for me.
This only applies to the click event, you can take care of the hover part likewise.
Please merge this into your code so my version won’t get overwritten with updates ??
Kind regads
Daniel
- The topic ‘Closing on Mobile’ is closed to new replies.