call more time jquery plugins (rollerblade) - javascript

I want to call rollerblade.js plugin each time a picture is clicked, but it works just once, & didn't work when I changed my HTML code...
I tried to call it in a function and set onclick to my picture, but that didn't work.
$("#show").rollerblade({
imageArray: arrayOfImages,
sensitivity: 5,
drag: true,
auto: false,
edgeStop: false
});

Related

bxSlider reloadSlider() is undefined after page load

I'm working on an intime upload+refresh gallery (AJAX and jQuery based)
application.
I can upload multiple images with drag & drop and after uploading. I have to see how will look like the new gallery with the uploaded elements, which is in a bxslider based carousel (without page reload). I've done this successfully with the upload-refresh part. However when refreshing the slides the bxslider attributes from configuration are being lost.
When I want to use the reloadSlider() function I see the following error in Chrome console:
Cannot read property 'reloadSlider' of undefined
$(document).ready(function() {
$('.gallery_output').bxSlider({
slideWidth: 222,
minSlides: 1,
maxSlides: 5,
pager: false,
slideMargin: 0
});
});
function refresh_slider() {
var sliderToRefresh = $('.gallery_output').bxSlider({
auto: true,
controls: true
});
sliderToRefresh.reloadSlider();
}
UPDATE:
I added a button to trigger the event, but got the same error.
$('#refresh').click(function(){
var sliderToRefresh;
sliderToRefresh = $('.gallery_output').bxSlider({
auto: true,
controls: true
});
sliderToRefresh.reloadSlider();
});
Overall I just want to reload the bxSlider with a triggered function, without page reload. Any ideas why the reloadSlider() doesn't work?
You're defining the bxSlider in .gallery_output then trying to access it on #gallery_output :)

How can I switch slides automatically in SlideJS from SlidesJS.com?

I am working on getting SlideJS running, and have some aspects of presentation and behavior in order.
One thing I haven't yet managed is to get it to automatically slide, or transition, from one slide to the next.
The code that is getting the reported error is line 67 in SlideJS's main plugin file, at the last line besides the closing brace below; my copy is at https://cjshayward.com/wp-content/Slides-SlidesJS-3/source/jquery.slides.js:
if (typeof TouchEvent !== "undefined") {
$.data(this, "touch", true);
this.options.effect.slide.speed = this.options.effect.slide.speed / 2;
}
Commenting out the assignment, with my invocation, suppresses the reported error, but I think the code may want more information than this line which appears to merely halve an existing setting. I can assign, without immediate reported error,
this.options.effect['qwerty'] = 'qwerty';
But I get a similar error (i.e. setting a property of undefined), if I have as much as:
this.options.effect.slide['qwerty'] = 'qwerty';
I've tried a number of configuration options, and I can see the manual circles to click to move between slides, but have not yet managed to get an automatic transition (the plugin supports slide or fade options; I want the 'slide' effect). My present options target is:
<script>// <![CDATA[
jQuery(function(){
jQuery('#slides').slidesjs({
slide:
{
speed: 200
},
interval: 2000,
active: true,
auto: true,
effect: 'slide',
height: 528,
interval: 5000,
pauseOnHover: true,
restartDelay: 2500,
swap: false,
width: 940
});
});
// ]]></script>
In view-source:http://www.slidesjs.com/, there are multiple sample invocatiosn, but the only invocation I see after slidejs.min.js's inclusion (the last script loaded from a URL) is:
<script>
$(function() {
$('#slides').slidesjs({
width: 940,
height: 350,
navigation: false
});
});
</script>
Thanks,
Have look at:-
https://jsfiddle.net/5x2tqdsv/
You need to fix your html and also remove the following line:-
effect: 'slide',
There were two issues.
One was that the HTML needed fixing.
The other was that the options were being presented, flat, where the source to http://www.slidesjs.com/examples/playing/ has:
$(function() {
$('#slides').slidesjs({
width: 940,
height: 528,
play: {
active: true,
auto: true,
interval: 4000,
swap: true,
pauseOnHover: true,
restartDelay: 2500
}
});
});
I presently have everything I want, besides the data initially displayed all at once before being Hijaxed (I should be able to address that several ways, and it's not my concern). Besides the HTML issue, there was another issue I had in that I was trying to use a flat dictionary to specify options when I needed to have one option/key (play) have its own dictionary as the value instead of e.g. a number or boolean as its value the way most other options appear to.
The updated JSfiddle I'm working from now is https://jsfiddle.net/ydvtynjL/

Jquery Infinite Scroll ( IAS ) disable cache

I am using jQuery + IAS to make infinite scroll, the problem is that i do not want cache disabled when making these requests.
Basically this is the URL is accesses to get the next page : http://example.com/flink-link?page=3&ccAC=1&_=1473840893821, I need the _=1473840893821 removed.
I have checked their documentation but found nothing, also i tried adding cache: true but it does not work.
Here is my trigger:
var ias = jQuery.ias({
container: '.movie_w',
item: '.movie',
pagination: '#pagination',
next: '.next',
cache: true,
negativeMargin: 600
});
ias.extension(new IASSpinnerExtension({
src: domain_root_url+'/media/themes/v/images/load2.gif',
}));
Try to add 'cache: true' to the ajax call (JQuery.ajax({})), not in your ias config's variable.
I had the same issue, and that work to me.

Lightbox_Me fadeOut Effect

I have been trying to set up LightBox_Me for a client. The idea is for an Age Verification overlay to appear when the page loads which asks "Are you over 18?". Yes or No. Upon clicking yes, the overlay disappears.
The Overlay will fade in, but I cannot work out how to get it to fade out.
Jive Release Notes with fadeOut support
The above link shows that the there should be support for fadeOut.
I have tried implementing this into the lightbox_me.js file which is where all of the appear effects are, but to no avail.
I have also tried implementing it into my age verification script, which is:
$(window).load(function () {
// Age Verification
if(!$.cookie('legal-age')){
$('#verify').lightbox_me({
centered: true,
closeClick: false,
closeESC: false,
//disappearEffect: fadeOut,
//overlayDisappearSpeed: 300,
//lightboxDisappearSpeed: fast,
overlayCSS: {background: '', opacity: 0},
closeSelector: '.v-yes',
onClose: function(){
$.cookie('legal-age','yes', {domain: '*Snip*', path: '/'});
}
});
e.preventDefault();
}
});
The code above shows the 3 lines of code that should determine the fadeout animations.
Any help would be appreciated.
Cheers
If you are using the 'latest' build (which is over two years old now), then those particular options are no longer available. They were originally added over three years ago, and subsequently removed 9 months later.
Unfortunately there doesn't appear to be a graceful built-in way to fade out a lightbox_me lightbox any longer. If you are comfortable with jQuery you could probably re-add the code that was removed from that first commit, although I suspect it was removed for good reason.
A couple of other things worth pointing out:
Unless you're using a pre-1.9.x version of jQuery, the script is going to error out around line 31 - you'll want to replace this:
ie6 = ($.browser.msie && $.browser.version < 7);
...with this:
ie6 = navigator.userAgent.match(/MSIE 6/);
And if you do intend to re-add these effects, you'll want to make sure your values for disappearEffect & lightboxDisappearSpeed are declared as strings, otherwise it will error out:
$('#verify').lightbox_me({
centered: true,
closeClick: false,
closeESC: false,
disappearEffect: 'fadeOut',
overlayDisappearSpeed: 300,
lightboxDisappearSpeed: 'fast',
overlayCSS: {background: '', opacity: 0},
closeSelector: '.v-yes',
onClose: function() {
$.cookie('legal-age','yes', {domain: '*Snip*', path: '/'});
}
});

Option generateNextPrev of SlideJS doesnt work

I've got a problem with SlideJS. I dont want to display the previous/next-Buttons, so i've set the Option generateNextPrev to false. But that doesnt do anything.
Does anyone have an idea what am I doing wrong ?
Here is the Code:
$("#articlesSlider1").slides({
generateNextPrev: false,
play: 5000,
pause: 2500,
width: 700,
height: 320,
});
Check first in your HTML markup. And search for code below:
Prev</i>
Next</i>
Delete it, and try again. If you already added that prev/next in your code, generateNextPrev: false, won't work. Normally you don't need to add that link in markup, since Slidejs can generate that prev/next links.

Categories

Resources