Jump to content

one works other dont


brentmoeller

Recommended Posts

maybe some wiz kid out their can help me figure out whats going on here. What suppose to happen is a random site suppose to load into a iframe

When the frameset code below is inside the <body> tags only the menubar shows up and not the iframe with a random site.

Now when i take the code and put it oustide the <body> tag the menubar goes away and only the iframe with a random site is shown .

The goal of course is to get the menubar to be visible and to have a  iframe with a random site loaded into it.

For some reason i can only get one of the two the happen. I do hope i explained this well enough

 

<frameset rows="80,*" BORDERCOLOR="#222222" BORDER="3">
          <frame src="explore.php" name="surfbar" marginwidth="O" marginheight="0" NORESIZE SCROLLING="no" />
          <frame src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> " name="random" marginwidth="O" marginheight="0" noresize scrolling="auto" />
</frameset>

--------------------------------------------------------------------------------------------------

<?php

/**
* @author Brent Moeller
* @copyright 2011
*/

include ('functions.php');
db_connect();

$result = mysql_query("SELECT * FROM slinks where approval='1' ORDER BY RAND() LIMIT 1") or
    die(mysql_error());

?> 
<html>
<head>
<title>DizzyUrl Discovery Engine</title>
<link rel="stylesheet" type="text/css" href="mouseovertabs.css" />

<script src="mouseovertabs.js" type="text/javascript">

/***********************************************
* Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>
</head>

<body>
<frameset rows="80,*" BORDERCOLOR="#222222" BORDER="3">
          <frame src="explore.php" name="surfbar" marginwidth="O" marginheight="0" NORESIZE SCROLLING="no" />
          <frame src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> " name="random" marginwidth="O" marginheight="0" noresize scrolling="auto" />
</frameset>
<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="http://www.javascriptkit.com" rel="gotsubmenu[selected]">JavaScript Kit</a></li>
<li><a href="http://www.cssdrive.com" rel="gotsubmenu">CSS Drive</a></li>
<li><a href="http://www.codingforums.com">No Sub Menu</a></li>
</ul>
</div>

<div id="mysubmenuarea" class="tabsmenucontentclass">

<!--1st link within submenu container should point to the external submenu contents file-->
<a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a>

</div>

<script type="text/javascript">
//mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout")
mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", true)

</script>

<noframes>
<p>This Browser does not support Frames.</p>
</noframes>

</body>


</html>

Link to comment
Share on other sites

Great so that answers the question that it needs to be outside of the body making the new code look like this

 

<?php

/**
* @author Brent Moeller
* @copyright 2011
*/

include ('functions.php');
db_connect();

$result = mysql_query("SELECT * FROM slinks where approval='1' ORDER BY RAND() LIMIT 1") or
    die(mysql_error());

?> 
<html>
<head>
<title>DizzyUrl Discovery Engine</title>
<link rel="stylesheet" type="text/css" href="mouseovertabs.css" />

<script src="mouseovertabs.js" type="text/javascript">

/***********************************************
* Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>
</head>
<frameset rows="80,*" BORDERCOLOR="#222222" BORDER="3">
          <frame src="explore.php" name="surfbar" marginwidth="O" marginheight="0" NORESIZE SCROLLING="no" />
          <frame src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> " name="random" marginwidth="O" marginheight="0" noresize scrolling="auto" />
</frameset>
<body>
<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="http://www.javascriptkit.com" rel="gotsubmenu[selected]">JavaScript Kit</a></li>
<li><a href="http://www.cssdrive.com" rel="gotsubmenu">CSS Drive</a></li>
<li><a href="http://www.codingforums.com">No Sub Menu</a></li>
</ul>
</div>

<div id="mysubmenuarea" class="tabsmenucontentclass">

<!--1st link within submenu container should point to the external submenu contents file-->
<a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a>

</div>

<script type="text/javascript">
//mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout")
mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", true)

</script>

<noframes>
<p>This Browser does not support Frames.</p>
</noframes>

</body>


</html>

 

Now the random site pops up but the menu bar isnt visible anymore. Why wold this be?

 

Link to comment
Share on other sites

Sorry, I should have explained more. FRAMESET (which has been depricated) actually REPLACES the body. Each FRAME in the FRAMESET creates a separate "document" to show. If the FRAMESET is shown in the browser, it will NOT also show the BODY element. In fact, I don't think it is valid to have a BODY in an HTML file with a FRAMESET (except possibly in the NOFRAMES section).

 

If you are set on using FRAMESET, the menu stuff (that you currently have in the BODY) needs to be included using a FRAME that references a separate file.

 

If you want to use an IFRAME, forget the whole FRAMESET thing, build the BODY as you want it using an IFRAME where you want the random site loaded - stick it in just like you would an IMG tag.

 

Link to comment
Share on other sites

Sorry, I should have explained more. FRAMESET (which has been depricated) actually REPLACES the body. Each FRAME in the FRAMESET creates a separate "document" to show. If the FRAMESET is shown in the browser, it will NOT also show the BODY element. In fact, I don't think it is valid to have a BODY in an HTML file with a FRAMESET (except possibly in the NOFRAMES section).

 

If you are set on using FRAMESET, the menu stuff (that you currently have in the BODY) needs to be included using a FRAME that references a separate file.

 

If you want to use an IFRAME, forget the whole FRAMESET thing, build the BODY as you want it using an IFRAME where you want the random site loaded - stick it in just like you would an IMG tag.

 

Thanks a Shi$ ton i got it to work by taking your advice

 

One more fast question. is it even possible to remove the scroll bars when using a iframe?

As you can see in the picture there is a scroll bar even tho i have with height and width set to 100%

Heres the new code i used after taking your advice

<?php

/**
* @author Brent Moeller
* @copyright 2011
*/

include ('functions.php');
db_connect();

$result = mysql_query("SELECT * FROM slinks where approval='1' ORDER BY RAND() LIMIT 1") or
    die(mysql_error());

?> 
<html>
<head>
<link rel="stylesheet" type="text/css" href="mouseovertabs.css" />

<script src="mouseovertabs.js" type="text/javascript">

/***********************************************
* Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>

<title>DizzyUrl Discovery Engine</title>
</head>
<body>
  <div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="http://localhost/Stumble/explore.php" rel="gotsubmenu[selected]">Stumble</a></li>
<li><a href="http://www.cssdrive.com" rel="gotsubmenu">CSS Drive</a></li>
<li><a href="http://www.codingforums.com">No Sub Menu</a></li>
</ul>
</div>

<div id="mysubmenuarea" class="tabsmenucontentclass">

<!--1st link within submenu container should point to the external submenu contents file-->
<a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a>

</div>

<script type="text/javascript">
//mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout")
mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", true)

</script>        
                    
          
<iframe>
          <iframe src="<?php while ($row = mysql_fetch_array($result)){ print $row["url"];}?> " name="surfbar" width="100%" height="100%"> noresize scrolling="auto" />
</iframe>


</body>

</html>

 

http://felonygames.com/uploads/images/FelonyGames.com-1299461612-U1.jpg

 

 

Link to comment
Share on other sites

Sorry, I don't know much about IFRAME. I played with it once, just to try to understand why the W3C would throw-away a perfectly good element (FRAMESET) and create the IFRAME. I still don't understand. Personally, I prefer the FRAMESET. I'm sure someone else with more experience will chime in here.

Link to comment
Share on other sites

yeah i just found out its possible to do

www.spinsnap.com/spin.php

this site here is using a Iframe like i am and as you can see they only have one scroll bar.

I tried to be sneaky and add

<body style="overflow: hidden">

but it failed to give me the desired results i was looking for..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.