Forum Moderators: open

Message Too Old, No Replies

rel attribute does not work with rotating image?

Script seems to think the page is still loading, always?!

         

JAB Creations

6:02 pm on Jul 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The rel attribute (XHTML equiv. of target) only works properly after a page has loaded (which in and of itself is a pain in the ass). However I have an iamge rotator that (another script) makes my rel script think the page is ALWAYS loading. Is this a JS bug or a browser bug perhaps?

Rambo Tribble

2:45 am on Jul 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does the script write to a window without closing it? That will perpetuate a load.

JAB Creations

12:51 am on Jul 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, single window solutions in my corner of the universe only. :-)

Rambo Tribble

12:58 am on Jul 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Might there be multiple calls to a setInterval assignment without a clearInterval in between?

JAB Creations

4:19 pm on Jul 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



While I have not the slightest clue what they are no I do not have the clear one.

rotateImgObj.start = function() {
for (var i=0; i<rotateImgObjs.length; i++)
rotateImgObjs[i].timer = setInterval(rotateImgObjs[i].animString + ".rotate()", rotateImgObjs[i].speed);
}

Rambo Tribble

10:37 pm on Jul 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If that function is called more than once, it could be the source of the problem. On the other hand, if it is only called once, it shouldn't be.

encyclo

10:50 pm on Jul 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What script are you using to open the new browser windows, JAB Creations?

JAB Creations

7:58 am on Jul 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here is the magic script which I thought was working just fine IoI...

function externalLinks()
{
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
var map = {external:"_blank",content:"content",border:"border",mplayer:"mplayer",top:"top"};
var anchor, i, target;

for (i=0; anchor=anchors[i++];)
if( anchor.getAttribute("href") && (target=map[anchor.getAttribute("rel")]))
anchor.setAttribute("target", target);

}
window.onload = externalLinks;