Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
IE problem with jQuery / png / css
Old 03-23-2009, 03:42 PM IE problem with jQuery / png / css
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
I have a .png image with it's opacity set to about 50%, which I've added a fadeIn jQuery effect to.

Surprisingly it doesn't work properly in IE, as the image fades in to 100% (it somehow seems to adjust the transparency of the image itself), before 'popping' back to its original opacity once the effect has completed.

Does anyone know of a workaround for this??
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 03-23-2009, 03:49 PM Re: IE problem with jQuery / png / css
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Instead of the $().fadeIn() method, use $().fadeTo(); to achieve what you need. http://docs.jquery.com/Effects/fadeTo
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 03-23-2009, 03:58 PM Re: IE problem with jQuery / png / css
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
Thanks for the quick response! Turns out I couldn't use it in the end though since the .png didn't look right with each layer on 100% opacity; but I'm sure itll come in useful at some point
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 03-23-2009, 04:01 PM Re: IE problem with jQuery / png / css
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
One thing I forgot to mention though is that the code Im using:

Code:
$(document).ready (function () {
    $('#coolText').addClass ('hidden');
    $("#coolText:hidden").fadeIn (2000);
 });
Wont work in Chrome for some reason! It just won't fade in, its as if it just stays hidden!
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 03-23-2009, 06:04 PM Re: IE problem with jQuery / png / css
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
What does the "hidden" class do? Also, what is the :hidden psuedoselector? I've never used one like that before. Or did you mean, "#coolText.hidden"?
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 03-24-2009, 08:33 AM Re: IE problem with jQuery / png / css
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
Hmmm I was going by the selectors used here?
http://docs.jquery.com/Effects/fadeIn#speedcallback
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 03-24-2009, 09:36 AM Re: IE problem with jQuery / png / css
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Ah, I see. I checked out the demos there. :hidden targets a div (or any element) which has a css display of "none". The display property is the only property that is targeted by fadeIn, fadeTo, etc, so if your "hidden" class does anything else....

I don't know why this wouldn't work in Chrome, but if you set display: none in a style attribute instead of a class, this should solve your problem.

***EDIT***
You may have seen this before, but the shortcut for setting display: none, is the hide() method. So instead of:
Code:
$('#coolText').addClass ('hidden');
You could just do:
Code:
$('#coolText').hide();
Which would be the same as:
Code:
$('#coolText').css("display", "none");
__________________
Join me on
Please login or register to view this content. Registration is FREE

Last edited by wayfarer07; 03-24-2009 at 09:51 AM..
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 03-24-2009, 10:00 AM Re: IE problem with jQuery / png / css
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
Diamond! Thanks a lot, I never knew about the hide() method
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Reply     « Reply to IE problem with jQuery / png / css
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27229 seconds with 12 queries