简体   繁体   中英

Jquery Coin Slider - not working at all

I'm trying to integrate Coin Slider into my page, and I've downloaded and attached the latest Jquery to my header, along with all of the necessary Coin-slider files. However, the page simply stacks the images as if I had simply inserted tags.

The paths for all of the files are correct. I tried following his instructions to the letter on the "how to install" page, with no success. It won't work in IE8, or the latest versions of Chrome or Firefox.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="css/paradigm.css" type="text/css" />
<link rel="stylesheet" href="css/coin-slider-styles.css" type="text/css" />
<script type="text/javascript" src="js/coin-slider.min.js"></script>
<script type="text/javascript" src="js/coin-slider.js"></script>
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Paradigm Solutions</title>
</head>
<body>
    <div id="container">
    <div id="header"></div>
    <div id="navbar"></div>
    <div id="leftMenu"></div>
    <div id="coin-slider">
        <a href="http://windows.microsoft.com/en-us/internet-explorer/products/ie/home/" target="_blank">
                <img src="http://www.vexite.com/images/2011/06/browser-war-illustration.jpg" alt="IESucks" />
                <span>
                    <b>Don't Use IE</b><br />
                    Internet Explorer is an inferior product that should be destroyed.
                </span>
            </a>

        <a href="http://windows.microsoft.com/en-us/internet-explorer/products/ie/home/" target="_blank">
                <img src="http://www.vexite.com/images/2011/06/browser-war-illustration.jpg" alt="IESucks" />
                <span>
                    <b>Don't Use IE</b><br />
                    Internet Explorer is an inferior product that should be destroyed.
                </span>
            </a>
    </div>


    </div>

<script type="text/javascript">
    $(document).ready(function() {
        $('#coin-slider').coinslider();
    });
</script>
</body>
</html>

Change your script tags from

<script type="text/javascript" src="js/coin-slider.min.js"></script>
<script type="text/javascript" src="js/coin-slider.js"></script>
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>

to

<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="js/coin-slider.min.js"></script>

coin-slider depends on jQuery therefore it must be loaded before.... And I would suggest you remove js/coin-slider.js as js/coin-slider.min.js and js/coin-slider.js are the same thing ... the .min is just a minified version of the other

The order of your javascript file includes is very important. jQuery should always be first (as is evident in the production documentation). Also, you don't need BOTH coin-slider includes. The .min will be enough:

<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="js/coin-slider.min.js">

这听起来似乎很明显,但是硬币滑动器包并不总是与jQuery打包在一起,因此在链接它之前,请确保在javascript文件夹中也有jQuery c(:

it works well

<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="coin-slider.min.js"></script>

<link rel="stylesheet" href="styles.css" type="text/css" />
<link rel="stylesheet" href="coin-slider-styles.css" type="text/css" />

check this link for code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM