Results 1 to 3 of 3

Thread: Javascript Carousel conflict

  1. #1
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Javascript Carousel conflict

    I am trying to use the Step Carousel Viewer v1.9 (http://www.dynamicdrive.com/dynamici...epcarousel.htm), but another Javascript of my page stops to function when I am using http://www.dynamicdrive.com/dynamici...tepcarousel.js

    This is the Javascript that stops to function:

    <script type="text/javascript">
    $(document).ready(function() {
    $('a[name=modal]').click(function(e) {
    e.preventDefault();
    var id = $(this).attr('href');
    var maskHeight = $(document).height();
    var maskWidth = $(window).width();
    $('#mask').css({'width':maskWidth,'height':maskHeight});
    $('#mask').fadeIn(1000);
    $('#mask').fadeTo("slow",0.8);

    //Get the window height and width
    var winH = $(window).height();
    var winW = $(window).width();
    $(id).css('top', winH/2-$(id).height()/2);
    $(id).css('left', winW/2-$(id).width()/2);
    $(id).fadeIn(2000);
    });
    $('.window .close').click(function (e) {
    e.preventDefault();
    $('#mask').hide();
    $('.window').hide();
    });
    $('#mask').click(function () {
    $(this).hide();
    $('.window').hide();
    });
    });
    </script>

    How I decide?

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    The stepcarousel is in jQuery noconflict mode and that is probably why the second script won't work. You could try to change

    $(document).ready(function() {

    to

    jQuery(document).ready(function($) {

    and see if that helps.

  3. #3
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am using jQuery to open one light box. I substituted for $(document).ready (function() { and alone opened #mask

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •