jQuery lightbox deletes my divs?

Discussion in 'jQuery' started by jeremyhowell, Jan 6, 2011.

  1. #1
    http://knrdesigns.frih.net/NewSite/portfolio.php?view=logos

    You will notice the two logos, when you hover over the first, it is deleted when your mouse leaves.

    The second does not get deleted because I have removed the onMouseOver and onMouseOut attributes from it.

    It seems if I call any javascript function from these divs it will delete them when you take your mouse off, really need help with this.

    If I remove the lightbox script it fixes it, so I am assuming something in jQuery is clashing with the javscript I had already?
     
    jeremyhowell, Jan 6, 2011 IP
  2. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #2
    :))
    Its because of this :
    onMouseOut="hide('logo1'); return false;" onMouseOver="show('logo1'); return false;"

    Lightbox doesn't have anything to do with it...

    You need to include jquery in your code in order for lightbox to run.

    And replace this :
    
    <script type="text/javascript">
    function show(id) {
    document.getElementById(id).style.visibility = "visible";
    }
    function hide(id) {
    document.getElementById(id).style.visibility = "hidden";
    }
    </script>
    
    HTML:
    With this :
    
    <script type="text/javascript">
    function show(id) {
    $('#'+id).fadeTo('fast',1);
    }
    function hide(id) {
    $('#'+id).fadeTo('slow',0.5);
    }
    </script>
    
    HTML:
     
    tvoodoo, Jan 6, 2011 IP
    jeremyhowell likes this.
  3. jeremyhowell

    jeremyhowell Member

    Messages:
    379
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    45
    #3
    If I add jquery.js to the code, the lightbox no longer works, if I add the lightbox to the code, then jQuery no longer works.

    So if I remove the include tag for jquery.js, then the lightbox will run, but if it there, then the lightbox will not.
     
    jeremyhowell, Jan 7, 2011 IP
  4. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #4
    tvoodoo, Jan 7, 2011 IP
  5. jeremyhowell

    jeremyhowell Member

    Messages:
    379
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    45
    #5
    Yes I am using that script
     
    jeremyhowell, Jan 7, 2011 IP
  6. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #6
    I don't see the lightbox css included in your initial example...
     
    tvoodoo, Jan 7, 2011 IP
  7. jeremyhowell

    jeremyhowell Member

    Messages:
    379
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    45
    #7
    it is appended to my stylesheet, stylesheet.css
     
    jeremyhowell, Jan 7, 2011 IP
  8. jeremyhowell

    jeremyhowell Member

    Messages:
    379
    Likes Received:
    7
    Best Answers:
    2
    Trophy Points:
    45
    #8
    jeremyhowell, Jan 7, 2011 IP