...

View Full Version : JS & Iframes 2 Questions



tingtejs
09-25-2008, 06:10 PM
#1. Problem
I have the highlighter roller script from here that I modified the <div> tag on to center the text array's and remove the highlighting. It works perfectly both locally and on line, inside the iframe with FF, Opera etc. but NOT with IE. IE gives an error of "beginclip" not defined when I display the script inside the iframe. (The script is in a seperate html file that loads in the iframe.) When I try the script stand alone in the html file locally or on line it works fine with IE but NOT inside the iframe !

This is the script:http://www.javascriptkit.com/script/cut57.shtml

Here is how I modified the <div> tag after a suggestion on these boards.

<div style="position:relative;left:0px;top:0px;">
<p id="highlighter" style="width: 100%;text-align: center;position:absolute;left:0;top:0;font-size:11px;font-family:arial;font-weight:bold;background-color:white;clip:rect(0px 0px auto 0px)"></p>
</div>

#2 Problem.

I have an iframe with a link to an anchor on the same page further down as the iframe. When you click it, the entire page reloads THEN jumps to the anchor. How can I get the link to simply jump to the anchor without reloading ? (<a href="index.html#DISASTER">) Is there a js way to do it ? Using a "target" tag does not work.

Thanks for all the great help and scripts btw.

tingtejs
09-27-2008, 11:32 PM
Solved the problem with IE
The script had a line:

clearTimeout(BeginClip)

I deleted the (BeginClip) part and it's fine in IE, FF, Opera iframes or not, on server or local. <<<<<<<<<<<<<is a puzzlement

However
I still cannot get a link referencing an anchor OUTSIDE the iframe on the same page to work without reloading the parent page first. Weird.

<a href="index.html#DISASTER"> so if anyone has a JS code that will do this
I would be grateful.

TIA



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum