Jquery fade effect doesn't work in FF

This piece of code fades out the div in IE. In Firefox 3.0.8, fade out and the div disappears immediately. I can not find anyone who mentions this issue.

   $(function() {
            $("#show").click(function() {
                $("#show").fadeOut('slow');
            });
        });


<div id="show">this is where to show it</div>
+3
source share
7 answers

Thanks for the help.

I found a problem. My example was not complete. I also included jquery-vsdoc.jsfor jQuery VS intellisense. By accepting this, he has earned.

I used this trick for future readers

<%if (false) { %>
<script src="common/jquery-vsdoc.js" type="text/javascript"></script>
<% } %>

Wierd.

+3
source

I kept banging my head about this problem and finally found my problem ... heading in "Scripts / jquery-1.3.2-vsdoc.js"

/ *
 * This file has been commented to support Visual Studio Intellisense.
 * You should not use this file at runtime inside the browser--it is only
 * intended to be used only for design-time IntelliSense.  Please use the
 * standard jQuery library for all production use.
 *
 * Comment version: 1.3.2a
 */

" " , , ...

, non -vsdoc jquery jquery-min

+7

Firefox 3.0.8 Windows XP.

, .

+1

,

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript">
</script>

<script type="text/javascript">
 $(function() {
            $("#show").click(function() {
                $("#show").fadeOut('slow');
            });
        });
</script>
   <div id="show">this is where to show it</div>
+1

. jquery-vsdoc.js.

: , , .

, .

, !

+1

My problem was that I first tried to make the animation in CSS and left it, which caused problems with this in jQuery.

    transition:.5s linear;
+1
source

You must put event.preventDefault () there to make it work.

$(function() {
     $("#show").click(function(event) {
        event.preventDefault();
        $("#show").fadeOut('slow');
     });
 });


<div id="show">this is where to show it</div>
0
source

Source: https://habr.com/ru/post/1706399/


All Articles