Coder Social home page Coder Social logo

jQuery uncaught error about slider HOT 11 CLOSED

jssor avatar jssor commented on August 15, 2024
jQuery uncaught error

from slider.

Comments (11)

jssor avatar jssor commented on August 15, 2024

please remove the following line,
var jssor_slider1 = $('#slider1_container').data('jssorSlider');

from slider.

jssor avatar jssor commented on August 15, 2024

Hi Artur,

please remove the following line,

var jssor_slider1 = $('#slider1_container').data('jssorSlider');

Regards,

Jssor

From: Artur [mailto:[email protected]]
Sent: Thursday, April 03, 2014 03:17
To: jssor/slider.js
Subject: [slider.js] jQuery uncaught error (#6)

Hi,

I'm trying to configurate the slider from the 0 and I ran into some issues.

I hope you can tell me what is causing them.

I'm fallowing your documentation to configure it and I'm trying to make it responsive.

But in the process I get this error:
Uncaught TypeError: Cannot call method '$SetScaleWidth' of undefined

Could you please take a look at my test page and tell me why this is happening?

Here is the link:
http://www.turdidesigns.com/es/testing-page

Thank you,

β€”
Reply to this email directly or view it on GitHub #6 . https://github.com/notifications/beacon/5205605__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxMjA4NTQwMywiZGF0YSI6eyJpZCI6MjkxMjg3MTJ9fQ==--2641d5b56b1b0b9a78a7e3758081d25def7e4e07.gif

from slider.

epiblue avatar epiblue commented on August 15, 2024

Perfect! That worked !!!

Thanks a lot, now I will continue configurating and I'll contact you if I'll need further help!

Again, Thank you very much! I love the flexibility of the slider and I really looking forward to configurate it to my needs!

Best wishes!

from slider.

jssor avatar jssor commented on August 15, 2024

Great!

Please feel free to contact if you need any help.

From: Artur [mailto:[email protected]]
Sent: Thursday, April 03, 2014 15:32
To: jssor/slider.js
Cc: jssor
Subject: Re: [slider.js] jQuery uncaught error (#6)

Perfect! That worked !!!

Thanks a lot, now I will continue configurating and I'll contact you if I'll need further help!

Again, Thank you very much! I love the flexibility of the slider and I really looking forward to configurate it to my needs!

Best wishes!

β€”
Reply to this email directly or view it on GitHub #6 (comment) . https://github.com/notifications/beacon/5205605__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxMjEyOTUzOSwiZGF0YSI6eyJpZCI6MjkxMjg3MTJ9fQ==--ddbc1ebef4a0bae3ff5beda7fadbd667f1ad59d0.gif

from slider.

epiblue avatar epiblue commented on August 15, 2024

Can you please take a look,

I try to add captions and not working, I can't understand why... Again, following your documentation...

http://www.turdidesigns.com/es/testing-page

Slider stops working when I add a div with u="caption"

Sorry,

Thanks,

from slider.

jssor avatar jssor commented on August 15, 2024
jQuery(document).ready(function ($) {  
    //define random caption transitions, if a caption specifies '*' as transition,
    //it will choose transition randomly every time from following transition array
    var _CaptionTransitions = [{$Duration:900,$FlyDirection:1,$Easing:{$Left:$JssorEasing$.$EaseInOutSine},$ScaleHorizontal:0.6,$Opacity:2}];
    //use following line instead if there is no caption plays random transition
    _CaptionTransitions["transtion_name1"] = {$Duration:900,$FlyDirection:1,$Easing:{$Left:$JssorEasing$.$EaseInOutSine},$ScaleHorizontal:0.6,$Opacity:2};

    var options = {
        $CaptionSliderOptions: {
            $Class: $JssorCaptionSlider$,
            $CaptionTransitions: _CaptionTransitions,
            $PlayInMode: 1,
            $PlayOutMode: 3
        }
    };

var jssor_slider1 = new $JssorSlider$('slider1_container', options);
    //responsive code begin
    //you can remove responsive code if you don't want the slider scales
    //while window resizes
    function ScaleSlider() {
        var parentWidth = $('#slider1_container').parent().width();
        if (parentWidth) {
            jssor_slider1.$SetScaleWidth(parentWidth);
        }
        else
            window.setTimeout(ScaleSlider, 30);
    }
    //Scale slider after document ready
    ScaleSlider();
    if (!navigator.userAgent.match(/(iPhone|iPod|iPad|BlackBerry|IEMobile)/)) {
        //Capture window resize event
        $(window).bind('resize', ScaleSlider);
    }
    //responsive code end 
});

from slider.

epiblue avatar epiblue commented on August 15, 2024

Now I get

jssor_slider1_starter is undefined...

:(

from slider.

epiblue avatar epiblue commented on August 15, 2024

any ideas? And suggestion to avoid it in the future?

from slider.

jssor avatar jssor commented on August 15, 2024

highly recommended that develop your slider separately.

develop your slider in a simple page, and then insert it into your page.

btw, the following code is not necessary,

<script>
$(function(){
jssor_slider1_starter('slider1_container');
});</script>

from slider.

epiblue avatar epiblue commented on August 15, 2024

OK, I have decided to develop it on my local machine.

BUT the problem is the same! It's not working.

Can you help, because I'm fallowing your documentation and it simply doesn't work...

Here is my code:

<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="http://www.turdidesigns.com/templates/epiblue/js/jquery-1.10.2.min.js"></script>
<script src="http://www.turdidesigns.com/templates/epiblue/js/jssor-slider/jssor.slider.mini.js"></script>
</head>
<body>
<div>
<div id="slider1_container" style="position: relative; top: 0px; left: 0px; width: 1200px; height: 300px; overflow: hidden;">
    <!-- Slides Container -->
    <div u="slides" style="cursor: move; position: absolute; overflow: hidden; left: 0px; top: 0px; width: 1200px; height: 300px;">
        <div>
          <img u="image" src="http://www.turdidesigns.com/images/covers/contacto.jpg" />
          <div u="caption" t="transition_name1" style="position: absolute; top: 30px; left: 30px; width: 50px;height: 50px;">
        </div>
        <div><img u="image" src="http://www.turdidesigns.com/images/covers/diseno-web.jpg" /></div>
    </div>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function ($) {  
    //define random caption transitions, if a caption specifies '*' as transition,
    //it will choose transition randomly every time from following transition array
    var _CaptionTransitions = [{$Duration:900,$FlyDirection:1,$Easing:{$Left:$JssorEasing$.$EaseInOutSine},$ScaleHorizontal:0.6,$Opacity:2}];
    //use following line instead if there is no caption plays random transition
    _CaptionTransitions["transtion_name1"] = {$Duration:900,$FlyDirection:1,$Easing:{$Left:$JssorEasing$.$EaseInOutSine},$ScaleHorizontal:0.6,$Opacity:2};

    var options = {
        $CaptionSliderOptions: {
            $Class: $JssorCaptionSlider$,
            $CaptionTransitions: _CaptionTransitions,
            $PlayInMode: 1,
            $PlayOutMode: 3
        }
    };

var jssor_slider1 = new $JssorSlider$('slider1_container', options);
    //responsive code begin
    //you can remove responsive code if you don't want the slider scales
    //while window resizes
    function ScaleSlider() {
        var parentWidth = $('#slider1_container').parent().width();
        if (parentWidth) {
            jssor_slider1.$SetScaleWidth(parentWidth);
        }
        else
            window.setTimeout(ScaleSlider, 30);
    }
    //Scale slider after document ready
    ScaleSlider();
    if (!navigator.userAgent.match(/(iPhone|iPod|iPad|BlackBerry|IEMobile)/)) {
        //Capture window resize event
        $(window).bind('resize', ScaleSlider);
    }
    //responsive code end 
});
</script>
</body>
</html>

It does respond to the screen, but nothing else works... I can't understand why.

And there are no errors in the console... I don't get it.

from slider.

jssor avatar jssor commented on August 15, 2024

Hi Artur,

Wrong slides html definition, you defined only one slide as follows,

        <div u="slides" style="cursor: move; position: absolute; overflow: hidden; left: 0px; top: 0px; width: 1200px; height: 300px;">

            <div>

                <img u="image" src="http://www.turdidesigns.com/images/covers/contacto.jpg" />

                <div u="caption" t="transition_name1" style="position: absolute; top: 30px; left: 30px; width: 50px;height: 50px;">

                </div>

                <div><img u="image" src="http://www.turdidesigns.com/images/covers/diseno-web.jpg" /></div>

            </div>

        </div>

It works when I change it to follows,

        <div u="slides" style="cursor: move; position: absolute; overflow: hidden; left: 0px; top: 0px; width: 1200px; height: 300px;">

            <div>

                <img u="image" src="http://www.turdidesigns.com/images/covers/contacto.jpg" />

                <div u="caption" t="transition_name1" style="position: absolute; top: 30px; left: 30px; width: 50px;height: 50px;">

                </div>

            </div>

            <div><img u="image" src="http://www.turdidesigns.com/images/covers/diseno-web.jpg" /></div>

        </div>

That’s to say, there must be at least 2 slides to make the slider work.

Regards,

Jssor

From: Artur [mailto:[email protected]]
Sent: Thursday, April 10, 2014 18:07
To: jssor/slider.js
Cc: jssor
Subject: Re: [slider.js] jQuery uncaught error (#6)

OK, I have decided to develop it on my local machine.

BUT the problem is the same! It's not working.

Can you help, because I'm fallowing your documentation and it simply doesn't work...

Here is my code:

<script type="text/javascript" src="http://www.turdidesigns.com/templates/epiblue/js/jquery-1.10.2.min.js"></script> <script src="http://www.turdidesigns.com/templates/epiblue/js/jssor-slider/jssor.slider.mini.js"></script>
<script type="text/javascript"> jQuery(document).ready(function ($) { //define random caption transitions, if a caption specifies '*' as transition, //it will choose transition randomly every time from following transition array var _CaptionTransitions = [{$Duration:900,$FlyDirection:1,$Easing:{$Left:$JssorEasing$.$EaseInOutSine},$ScaleHorizontal:0.6,$Opacity:2}]; //use following line instead if there is no caption plays random transition _CaptionTransitions["transtion_name1"] = {$Duration:900,$FlyDirection:1,$Easing:{$Left:$JssorEasing$.$EaseInOutSine},$ScaleHorizontal:0.6,$Opacity:2}; var options = { $CaptionSliderOptions: { $Class: $JssorCaptionSlider$, $CaptionTransitions: _CaptionTransitions, $PlayInMode: 1, $PlayOutMode: 3 } }; var jssor_slider1 = new $JssorSlider$('slider1_container', options); //responsive code begin //you can remove responsive code if you don't want the slider scales //while window resizes function ScaleSlider() { var parentWidth = $('#slider1_container').parent().width(); if (parentWidth) { jssor_slider1.$SetScaleWidth(parentWidth); } else window.setTimeout(ScaleSlider, 30); } //Scale slider after document ready ScaleSlider(); if (!navigator.userAgent.match(/(iPhone|iPod|iPad|BlackBerry|IEMobile)/)) { //Capture window resize event $(window).bind('resize', ScaleSlider); } //responsive code end }); </script>

β€”
Reply to this email directly or view it on GitHub #6 (comment) . https://github.com/notifications/beacon/5205605__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxMjc0MzU5MiwiZGF0YSI6eyJpZCI6MjkxMjg3MTJ9fQ==--c29011faaa591cc8c5258d32afbdb6de68419f83.gif

from slider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.