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.

HTML Forum


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



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
CSS, Firefox, and Visibility: hidden
Old 08-16-2006, 07:36 PM CSS, Firefox, and Visibility: hidden
Average Talker

Posts: 15
Trades: 0
Hi guys..

my main feature on this layout uses hidden divs and a javascript that slides through them.

It's working fine in IE.. but doesn't show up at all in Firefox.

Now i've read places that firefox doesn't like support Visibility: hidden... but does support display: block / none.

So I tried switchin the visibility portions of the script to display: none... and it gave me the same result.

Please someone view source on this link, and see if you can help me get to the bottom of this.

GEO GIFTS

Thanks!
-Mike
megaholic is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-16-2006, 11:05 PM Re: CSS, Firefox, and Visibility: hidden
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Your using document.all which is IE only I think. Someone please correct me if I'm wrong about this.

On the image you want to change use id="SlideShow" and then in the JavaScript you can access the image with.

image = document.getElementById("SlideShow")

and then:

image.style.

However there's one more problem. Those filters you're trying to use while a nice effect are also IE only. So they just won't work anywhere else.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

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

Last edited by vangogh; 08-16-2006 at 11:06 PM..
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 08-17-2006, 08:21 AM Re: CSS, Firefox, and Visibility: hidden
Average Talker

Posts: 15
Trades: 0
Hi, I'm not going to worry about the top fading images for now.. but I just want to get the featured product area working.(the one with NEXT and PREV buttons).

I'll post the javascript for that as it was located in 'slide.js':

Code:
 
// Cross-browser cleanup by Paul Anderson, CNET Builder.com. All rights reserved.
var numSlides = 4;
var currentSlide = numSlides;
function setUp() {
if (!document.all) {
document.all = document;
for (i=1;i<=numSlides;i++) document.all[("image"+i)].style=document.all[("image"+i)];
}
switchSlide(1);
}
function switchToSlide(sDir) {
newSlide = sDir;
if (!newSlide) newSlide=numSlides;
if (newSlide > numSlides) newSlide=1;
document.all[("image"+currentSlide)].style.visibility="hidden";
document.all[("image"+newSlide)].style.visibility="visible";
currentSlide = newSlide;
}
 
function switchSlide(sDir) {
newSlide = currentSlide + sDir;
if (!newSlide) newSlide=numSlides;
if (newSlide > numSlides) newSlide=1;
document.all[("image"+newSlide)].style.visibility="visible";
document.all[("image"+currentSlide)].style.visibility="hidden";
currentSlide = newSlide;
}
and here's the code for creating my 4 hidden divs from the database:
Code:
 <span id="feature" style="position:relative;">
<?
$count =0;
while ($row = mysql_fetch_assoc($result)) {
$count++; $imageid = "image".$count;?>
<DIV id="<?echo $imageid ?>" class="slides">
<table cellpadding=0 cellspacing=0 style="height:245px; border: 1px solid #1A82AC;">
<tr height="165">
<td align=center valign=middle>
<a href="feature.php?show=<?echo $row["feat_id"];?>"><img src="<?echo $row["image_file"];?>" border="0" class="lg"></a>
</td>
</tr>
<tr height="80"><td valign=top bgcolor=#E8F2F7 style="padding: 5px;">
<h1><?echo $row["feature_name"];?></h1><?echo $row["short_desc"];?>
<div style="float: right;"><strong><a href="feature.php?show=<?echo $row["feat_id"];?>">Read More...</a></strong></div></td></tr>
</table>
<table><tr><td align="left"><a href="javascript:switchSlide(-1)">&laquo; Prev</a></td><td align="center"><a href="javascript:switchToSlide(1)">1</a> - <a href="javascript:switchToSlide(2)">2</a> - <a href="javascript:switchToSlide(3)">3</a> - <a href="javascript:switchToSlide(4)">4</a></td><td align="right"><a href="javascript:switchSlide(1)">Next &raquo;</a></td></table>
</div>
<? } mysql_free_result($result); ?>
</span>


Now with the fix that you just gave me, i'm not quite sure exactly how to implement it.. i'm kinda confusing myself here. Please help further. Thanks

Last edited by megaholic; 08-17-2006 at 08:26 AM..
megaholic is offline
Reply With Quote
View Public Profile
 
Old 08-17-2006, 12:57 PM Re: CSS, Firefox, and Visibility: hidden
Average Talker

Posts: 15
Trades: 0
solved

here's the working code:

Code:
// Cross-browser cleanup by Paul Anderson, CNET Builder.com. All rights reserved.
var numSlides = 4;
var currentSlide = numSlides;
function setUp() {
switchSlide(1);
}
function switchToSlide(sDir) {
newSlide = sDir;
if (!newSlide) newSlide=numSlides;
if (newSlide > numSlides) newSlide=1;
document.getElementById("image"+currentSlide).style.display="none";
document.getElementById("image"+newSlide).style.display="block";
currentSlide = newSlide;
}

function switchSlide(sDir) {
newSlide = currentSlide + sDir;
if (!newSlide) newSlide=numSlides;
if (newSlide > numSlides) newSlide=1;
document.getElementById("image"+currentSlide).style.display="none";
document.getElementById("image"+newSlide).style.display="block";
currentSlide = newSlide;
}

Last edited by megaholic; 08-17-2006 at 01:00 PM..
megaholic is offline
Reply With Quote
View Public Profile
 
Old 08-17-2006, 01:02 PM Re: CSS, Firefox, and Visibility: hidden
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
I'm not sure if you've been working on it since you last posted, but that section is looking the same to me in both Firefox and IE. Have you managed to get ot working or am I missing something?

Right now the only difference I'm seeing between the two browsers is that in IE the images at the top do have the fading where they don't in Firefox. Everything else is looking the same though I have been known to miss things in the past. Am I missing something now?
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 08-17-2006, 01:11 PM Re: CSS, Firefox, and Visibility: hidden
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Looks like you solved things just as I was posting that it looked like it was working.

Glad you got it all worked out and it looks good.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to CSS, Firefox, and Visibility: hidden
 

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.23235 seconds with 12 queries