Web Design and Development Forums

Open html inside Div on mouse click

This is a discussion on "Open html inside Div on mouse click" within the JavaScript Forum section. This forum, and the thread "Open html inside Div on mouse click are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > JavaScript Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Apr 20th, 2008, 15:41   #1 (permalink)
New Member
 
Join Date: Apr 2008
Location: Liverpool
Age: 30
Posts: 1
Open html inside Div on mouse click

Hi, I am currenty coding my site and decided it would look good to have a div styled layout.

I have managed to get the 1st part (mouse hover) of my problem to work using this code:

In the head:
Code: Select all
 <script>
<!--

var content=new Array()

content[0]='<br><big><b>OPTION 1</b></big><br>Enter text here'
content[1]='<br><big><b>OPTION 2</b></big><br>Enter text here'

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
appear()
setTimeout("window.onresize=regenerate",530)
}
}

function changetext(whichcontent){

if (document.all||document.getElementById){
cross_el=document.getElementById? document.getElementById("descriptions"):document.all.descriptions
cross_el.innerHTML='<font face="Verdana"><small>'+whichcontent+'<font></small>'
}
else if (document.layers){
document.d1.document.d2.document.write('<font face="Verdana"><small>'+whichcontent+'</small></font>')
document.d1.document.d2.document.close()
}

}

function appear(){
document.d1.visibility='show'
}

window.onload=regenerate2


//-->
</script>
And in the body:
Code: Select all
<div id="scriptmenu" style="line-height:20px"><p>
            <a href="1.html" onMouseover="changetext(content[0])"><small>OPTION 1</small></a><br>
            <a href="2.html" onMouseover="changetext(content[1])"><small>OPTION 2</small></a><br></div>
If you click on Option 1, it loads 1.html in a new window. What I would like is to open 1.html INSIDE a div layer named Box, then if you click OPTION 2, 2.html would open instead in the same div layer.

Hope this makes sense, and can anyone help?
NYCSavage is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 21st, 2008, 13:27   #2 (permalink)
Moderator
 
spinal007's Avatar
 
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,609
Blog Entries: 1
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Open html inside Div on mouse click

Code: Select all
<a href="1.html" onClick="showBox(content[0]); return false;" onMouseover="changetext(content[0])"
...then create the showBox function to do whatever you want it to do.
..."return false;" stops the link form being followed.
__________________
Diego - SEO Consultant London (My Blog | Fight Me)
jQuery: Star Rating - Multiple File Upload - FCKEditor/Codepress
Before we work on artificial intelligence why don't we do something about natural stupidity?

Last edited by spinal007; Apr 21st, 2008 at 13:29.
spinal007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i create this mouse cursor in HTML? fmpfmpf HTML Forum 1 Apr 15th, 2008 06:59
Media player inside HTML. McAurthur19 HTML Forum 6 Feb 18th, 2007 14:09
Media player inside HTML. sannbe Introduce Yourself 5 Feb 15th, 2007 21:52
Render HTML inside CDATA with XSL zweb XML, RSS & Atom 0 Sep 10th, 2006 16:19
HTML inside of flash..... courtjester Flash & Multimedia Forum 12 Mar 30th, 2004 12:24



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 23:28.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59