Jump to content

Adding rows to SmartFrames script


josephbupe

Recommended Posts

Hi,

 

I am developing a web application which will be comprised of three columns: (1) Search form, (2) Image gallery, (3) Image details. The site is going to be more like html framesets, but research reveals that framesets are not favourable due to many reasons. I however found an alternative that I want to use instead of html framesets http://www.ironspider.ca/frames/smartframes.htm

 

I thought it would be easy for me to add rows which should serve as a page header, but I was wrong. I tried adding

 

 

document.write('<frameset rows="17%,*" frameborder="no">');

 

to this part of the code, but row apeared in a wrong place at the bottom:

// Writes frameset

document.write('<frameset rows="17%,*" frameborder="no">');
document.write('<frameset cols="25%,75%" frameborder="no">');
document.write('<frame src="' + menuURL + '" name="menu">');
document.write('<frame src="' + contentURL + '" name="content" marginheight="15" marginwidth="50" scrolling="yes">');
// -->

The original script for the index.html page is as follows:

<!--
/* SmartFrames - Author: Robert Darrell - http://www.ironspider.ca/ */
// Defines variables
// REPLACE menu.htm WITH YOUR MENU PAGE
// REPLACE page1.htm WITH YOUR INITIAL CONTENT PAGE
menuURL = "menu.htm";
contentURL = "page1.htm";
reloadURL = parent.document.URL;
orphanURL = reloadURL.substring(reloadURL.indexOf('?')+1, reloadURL.indexOf('&'));
frameName = reloadURL.substring(reloadURL.indexOf('&')+1, reloadURL.length);

// Reassigns variable according to frame name passed by orphan
if (frameName == "menu") {
menuURL = orphanURL; 
} else if (frameName == "content") {
contentURL = orphanURL;
}

// Writes frameset
document.write('<frameset cols="25%,75%" frameborder="no">');
document.write('<frame src="' + menuURL + '" name="menu">');
document.write('<frame src="' + contentURL + '" name="content" marginheight="15" marginwidth="50" scrolling="yes">');
// -->
</script>

<!-- Use the noframes section to help search engines index your site -->
<noframes>THIS WEBSITE IS ABOUT...<br><br>
<a href="menu.htm">Site Menu</a>
</noframes>

</frameset>

I hope someone will help.

 

Regards.

 

joseph

 

Link to comment
https://forums.phpfreaks.com/topic/290974-adding-rows-to-smartframes-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.