Jquery Infinite Scroll ( IAS ) disable cache - javascript

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.

Related

call more time jquery plugins (rollerblade)

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
});

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 functions and infinite scroll elements

I have a script that popup a window for every link with class attached
jQuery(document).ready(function() {
jQuery('.product-quick-view a').magnificPopup({
type: 'ajax',
midClick: true,
mainClass: 'mfp-fade'
});
});
And it works fine but only for elements that is shown on first page. When i scroll down page and infinite scroll add next products to page , the script wont work (to that products).
I think you need to add this:
$(document).ajaxSuccess(function(){
jQuery('.product-quick-view a').magnificPopup({
type: 'ajax',
midClick: true,
mainClass: 'mfp-fade'
});
});
The above will be executed whenever a ajax is successfully completed.

AnythingSlider not working

I've recently implemented anythingslider into my website (built on wordpress). The default slider works great.
I was reading into the docs on github and want to use it exactly like this demo. http://jsfiddle.net/Mottie/ycUB6/76/.
This is the perfect functionality for my site. However, when I copy the code over from jsfiddle to my site it doesn't work at all. Even though i already have the slider working on the page with this code:
// DOM Ready
$(function(){
$('#sliderwho').anythingSlider({
buildArrows : false,
buildStartStop : false,
autoPlay : true,
mode : "fade",
appendControlsTo : '.slider-nav',
hashTags : false,
});
});
Any help would be great.
Thanks
with hashTags : false, you have a trailing "," which tells JS that there is supposed to be another property for your object.
with the limited code you provided thats all i saw - I'm making the assumption you have event handlers elsewhere....
so an updated version of the object would look like
// DOM Ready
$(function(){
$('#sliderwho').anythingSlider({
buildArrows : false,
buildStartStop : false,
autoPlay : true,
mode : "fade",
appendControlsTo : '.slider-nav',
hashTags : false /*removed the extra ',' */
});
});

prevent scrolling to top of page with iscroll?

I use jqtouch and iscroll for my app.
I load all pages with ajax and when I go back from a ajax loaded page to the index (menulist) page, that page scrolls to the top.
How can I prevent this?
Thanks.
have you tried to set the option checkDOMChanges to false?
I believe there is a boolean option called topOnDOMChanges
var scroll = new iScroll(contentid, {
desktopCompatibility: true,
bounce: true,
momentum: true,
checkDOMChanges: false,
topOnDOMChanges: false
});
From the Beedesk fork of JQTouch https://github.com/beedesk/jQTouch/blob/master/demos/main/index.html

Categories

Resources