0

I have read that I have to put back in the event handler for it to work in dreamweaver from JS Fiddle, I have put it back in and I it still wont work? Here is the Demo: http://jsfiddle.net/EfLJJ/6/

Here is my JS Code:

$(document).ready(function() {
$(".list .fs1").bind({
    mouseenter:function(){
        $(".sublist").show();
    },
    mouseleave: function(){
        $(".sublist").hide();
    }
    });
});  

4 Answers4

1

Add the jQuery library to your script.

Put this code inside the <head> tags of your page:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
Sergio
  • 28,539
  • 11
  • 85
  • 132
  • I have put the script in the meta tags is this right? If this is right it still doesn't work? content="text/html; charset=utf-8" http-equiv="Content-Type" /> Transition Box – fudgematico Jan 19 '14 at 21:15
  • @fudgematico sorry, I am tired! I meant inside the __head__ tags: ` `` – Sergio Jan 19 '14 at 21:17
0

In your html code inside head put this line of code in order to include the jQuery library:

<script src="//code.jquery.com/jquery-1.10.2.js"></script>

Otherwise will not be able to use it.

In jsfiddle this works in a different way.

  • This still doesn't work I have added the follow: The "Transitionbox.js" uses the same code that I posted at the top. – fudgematico Jan 19 '14 at 21:57
0

Also, if you're using jQuery version 1.7 and above, I'd recommend you switch from using ".bind()" to ".on()" for as ".on()" is the preferred method according to the jquery website. Check out the difference between ".bind()", ".on()" and ".live()" for more info here, What's the difference between `on` and `live` or `bind`?

Community
  • 1
  • 1
EmileKumfa
  • 414
  • 3
  • 6
  • That doesn't work either? Any suggestions? This code is sat below my CSS code and is in the ? – fudgematico Jan 19 '14 at 22:29
0

Problem solved! To get it running in Dreamweaver you have to use the Javascript Script Tags

Javascript:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
        /* Your Code Here */
    </script>