Log in

View Full Version : Resolved IE - Skip Code?



Schmoopy
11-20-2008, 08:15 PM
Hi, is there anyway of skipping code so that it doesn't get seen in IE? I have a page working in FF and Opera, but in IE, if I take a specific block of code out, it works for that too. I know you can write conditional statements, but only to add stylesheets, or add other code.

But does anyone know a way of making it skip the code if the browser is IE?

For example:

<!--[if IE ]>
Jump to line 30
<![endif]-->

Obviously, the way mentioned above isn't valid, but is there anything similar?

Thanks,

Jack

Snookerman
11-20-2008, 08:30 PM
What code do you want to skip? Maybe there's a workaround, unless of course there's a simple method of skipping code (I don't know of one).

Schmoopy
11-20-2008, 08:35 PM
Umm, it's a bit fiddly code, here it is :



<div id="ivyleaf" class="ukcentres"><div class="centretitle">Ivyleaf Mountainboarding <br/>Centre</div>
<span style="font-size:20pt; font-weight:normal; padding-left:15px; padding-bottom:19px; padding-top:15px; color:#000; background-color:#ff9933; width:470px; font-family:verdana; display:block; height:10px;">
<span class="triangle" style="background:url(images/triangle.gif) no-repeat; display:block; width:30px; height:27px; margin-left:248px; margin-top:9px;"></span></span>
<span style="float:right; font-size:12px; font-family:verdana; margin-top:-20px; z-index:5; background-color:#000; height:18px; padding-top:7px; margin-bottom:-5px; width:190px;">
<span class="titlebarleft"><a id="ivyinfotab" style="cursor:pointer;" onclick="HideThis('ivyinfo'); HideThis('ivygallery'); HideThis('ivycalendar'); toggle_visibility('ivyinfo'); TabSelect('ivyinfotab','ivygallerytab','ivycalendartab');">info</a></span><span class="boxlink" style="margin-right:20px; padding-top:5px; padding-bottom:5px;"><a id="ivygallerytab" style="cursor:pointer;" onclick="HideThis('ivyinfo'); HideThis('ivygallery'); HideThis('ivycalendar'); toggle_visibility('ivygallery'); TabSelect('ivygallerytab','ivyinfotab','ivycalendartab'); return false;">gallery</a></span><span class="boxlink" style="margin-right:20px;"><a id="ivycalendartab" style="cursor:pointer;" onclick="HideThis('ivyinfo'); HideThis('ivygallery'); HideThis('ivycalendar'); toggle_visibility('ivycalendar'); TabSelect('ivycalendartab','ivygallerytab','ivyinfotab'); return false">calendar</a></span></span><p></p><div id="ivyinfo" style="padding:10px; display:block;"><span class="boldund">Address:</span> Ivyleaf, Stratton, Bude, Cornwall, EX23 9LD<br/><span class="boldund">Tel:</span> 07773 069716<br/><span class="boldund">Email:</span> info@ivyleafmountainboarding.co.uk<br/><span class="boldund">Web:</span> <a href="http://www.ivyleafmountainboarding.co.uk/" target="_blank">www.ivyleafmountainboarding.co.uk</a><br/><span class="boldund">Skill level:</span> Beginner to advanced<br/><span class="boldund">Opening times:</span><br/>Sun-Fri: 10am-4pm<br/> Sat: Closed<br/> Club (Sun): 2pm-4pm</div>
<div id="ivygallery" style="display:none; padding-left:10px; padding-bottom:10px;">Pictures coming soon...</div>
<div id="ivycalendar" style="display:none; padding-left:10px; padding-bottom:10px;">Calendar coming soon...</div>
</div> <!-- End Ivyleaf -->


The code I want to skip is the:

<span style="font-size:20pt; font-weight:normal; padding-left:15px; padding-bottom:19px; padding-top:15px; color:#000; background-color:#ff9933; width:470px; font-family:verdana; display:block; height:10px;">

I've tried it and when I do this the page works in IE

Snookerman
11-20-2008, 08:58 PM
That's a lot of code. Is it really necessary to remove everything? Maybe you could just fix the part that is causing the problem (what is the problem btw?) so it works in all browsers.

Schmoopy
11-20-2008, 09:08 PM
I've put up a link to the page so you can see it in action...

Note that the menu is broken in IE too, but I'm working on it and shouldn't be a problem.

The centre that I'm referring to is the "Ivyleaf Mountainboarding Centre", it's in the south west, 2 from the left, I'm aware that the other centres look weird, as I'm still getting this template right so I can apply it to all of them.

You'll see what I mean when you look at it in IE:

http://www.bombthehills.com/test/ridingspots-uk.html

Schmoopy
11-21-2008, 02:33 AM
Ok, I restructured the code and now it works in all browsers :)

Snookerman
11-21-2008, 07:40 AM
Good job, that's much better than hacking.