开发者

jQuery: if my css visibility:hidden, how can i appear my elements?

开发者 https://www.devze.com 2023-01-30 01:45 出处:网络
in my css i\'ve set some elements visibiliy:hidden, how can I show them? I\'ve done it before with opacity, but i\'ve some bug in IE:

in my css i've set some elements visibiliy:hidden, how can I show them?

I've done it before with opacity, but i've some bug in IE:

var i = 0;
$mySelection.each(function(i) {
    $(this).delay((i * 100) + ($mySelection.length)).animate(
        { opacity: "1"},
        {queue:true, duration:1000, easing:"quartEaseIn"}
    ); 
})

How can i do if I want contro开发者_如何学运维ll visibility with jQuery instead of opacity? thank you


$(":hidden").css("visibility", "visible");


Rather than using visibility: hidden, use display:none, then if you want to fade in your hidden element use fadeIn. For example:

$("div:hidden").fadeIn("slow");

Edit: Given that you want to use visibility, try this:

var i = 0;
$mySelection.each(function(i) {
    $(this).delay((i * 100) + ($mySelection.length)).css(
        { 'opacity': '0', 'visibility': 'visible'}).animate(
            { opacity: "1"},
            {queue:true, duration:1000, easing:"quartEaseIn"});
});


I used this code to change the CSS visibility attribute with Jquery. Where the element1 on hover will change visibility of element2.

Did two different script for same element to give a mouseover-mouseleave effect.

 <script>$(document).ready(function(){
 $(".element1").mouseover(function(){
     $(".element2").css("visibility","visible");
 });

});

         <script>$(document).ready(function(){
 $(".element1").mouseleave (function(){
     $(".element2").css("visibility","hidden");
 });

});

Note.- That Element2 the one thats CSS is being affected, originally is hidden. so when mouse is over Element1, Element2 shows up. When mouse leaves element1, Element2 Hides again. Hope it helps

-Expiriance of this code reaserching and mixing some other codes from users in stack overflow


$(':hidden').show();

I hope this helps and I hope I understood your question :) http://api.jquery.com/show/


Try

$mySelection.show();
0

精彩评论

暂无评论...
验证码 换一张
取 消