X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   jQuery Image Slider (https://forum.x-cart.com/showthread.php?t=55112)

sdfjlsdfsdf 08-17-2010 02:24 AM

jQuery Image Slider
 
I have implemented the Nivo Slider - http://nivo.dev7studios.com/

Onto our site - http://www.chemist-4-u.com

And for the life of me I cannot understand why all the images are opening on load.

I have placed the div information into - "welcome.tpl" from skin1/customer/main and then the stylesheet and JavaScript links into - "home.tpl" from skin1/customer

It seems like the entire page loads before it processes the JavaScript properly.

I'm sure it's going to be something really simple but any ideas of where to go from here would be fantastic.

Shamun 08-17-2010 05:46 AM

Re: jQuery Image Slider
 
jQuery usually doesn't mess with the page until its ready to be manipulated. Infact that's one of the selling points of it.

If you want, you can add a height and overflow: hidden to #slider
That would make it so the images except for the first one is hidden until the page loads or the user enables javascript.

sdfjlsdfsdf 08-17-2010 06:10 AM

Re: jQuery Image Slider
 
Hi Tal thanks for the advice, I tried putting a height and overflow:hidden into my sliders CSS but I'm still getting the same results.

I tried it in .slider, .slider img, and slider a.nivo-imageLink but it still is having none of it. Really pulling my hair out on this one!

sdfjlsdfsdf 08-17-2010 06:56 AM

Re: jQuery Image Slider
 
Hi again,

Solved it! I was being silly and putting the height and overflow information into class sections.

Thanks heaps Tal will keep you in mind for small jobs!

sdfjlsdfsdf 08-17-2010 07:13 AM

Re: jQuery Image Slider
 
Ok I spoke to soon :(

All is well in Chrome + Firefox, but for some reason Internet Explorer is overlapping the images onto one another... Any ideas?

bjt 12-13-2010 07:57 AM

Re: jQuery Image Slider
 
I've tried the suggestions on the forum for the Nivo slider but can't get it to work. In IE it shows a javascript error and in FF it just shows all my images at once.
The test site is http://bennettdirect.staging.dynamix.com.au/home.php if anyone can suggest a solution.

Shamun 12-13-2010 05:21 PM

Re: jQuery Image Slider
 
Quote:

Originally Posted by bjt
I've tried the suggestions on the forum for the Nivo slider but can't get it to work. In IE it shows a javascript error and in FF it just shows all my images at once.
The test site is http://bennettdirect.staging.dynamix.com.au/home.php if anyone can suggest a solution.

Code:

$("#slider").nivoSlider is not a function

That's the error given.
You should try removing X-carts default version of jQuery since you've included your own which is more recent. That could very well be your problem.

jlrentertainment 02-01-2011 01:02 PM

Re: jQuery Image Slider
 
I am having the same problem, I added the jquery 1.4.2 in my meta.tpl as below, but I'm still getting this error.
HTML Code:

  {if $config.UA.browser eq 'Safari'}
    <script type="text/javascript" src="{$SkinDir}/jquery-safari.js"></script>
  {else}
    <script type="text/javascript" src="{$SkinDir}/jquery-min-142.js"></script>
  {/if}
  <script type="text/javascript" src="{$SkinDir}/jquery-fix.js"></script>
  <script type="text/javascript" src="{$SkinDir}/ajax.js"></script>


I also changed these back and forth:

I also changed
HTML Code:


  {literal}
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>{/literal}

to:
HTML Code:


  {literal}
<script type="text/javascript">
$(window).load(function() {
jQuery('#slider').nivoSlider();
});
</script>{/literal}


I'm so lost with this one. I never imagined that adding a little bit of javascript to X-Cart would be such a headache. If anybody can help me, I would greatly appreciate it.

mekon 02-04-2011 08:22 AM

Re: jQuery Image Slider
 
I had a problem were xcart seemed to be striping:

$('#slider').nivoSlider();

So I put the whole lot:

$(window).load(function() {
$('#slider').nivoSlider();
});

into a new js file and loaded in after:

<script type="text/javascript" src="/skin/common_files/slider/load.js"></script>

Will Hayes 02-04-2011 11:40 PM

Re: jQuery Image Slider
 
Hi guys,

If you would like to use a commercial alternative (that just works - no fuss),
then take a look at our xBanners banner manage module specifically developed for x-cart.

Download your 15 day free trial first and see how xBanners can transform your site.

http://www.thexcartstore.com/xbanners-banner-module-for-xcart.html

regards
W.


All times are GMT -8. The time now is 01:23 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.