PDA

View Full Version : Newbie needs HELP....



Flyguy
11-19-2004, 05:56 AM
I have a simple table based HTML webpage. 3 rows, 4 columns.

Top column is a image/logo
Second row is a nav bar with image buttons (jpg) and a java based rollover script

third row is where i need help. I want to be able to click on one of my nav buttons and instead of an entire page loading, i just want whats in the third table row to change. Text, images, what ever.

I want it to act just like this.....
http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm
but instead of a tab, have a image button with mouse over and when you actually click on the button, it behaves just like the above link, but in a different table row.


Am I in the right place?

simonf
11-19-2004, 06:27 AM
Hi Using the script you quoted, I modified a line ot show you a button replacing the text etc. rgds,Simonf :cool:

<li><a href="http://www.dynamicdrive.com" class="current" onClick="return expandcontent('sc1', this)"><img border="0" id="img1" src="button7.jpg" height="20" width="100" alt="Dynamic Drive" fp-style="fp-btn: Embossed Capsule 1" fp-title="Dynamic Drive" onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'button8.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'button7.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'button9.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'button8.jpg')"></a></td></li>
<li><a href="new.htm" onClick="return expandcontent('sc2', this)" theme="#EAEAFF">What's New</a></li>
<li><a href="hot.htm" onClick="return expandcontent('sc3', this)" theme="#FFE6E6">What's Hot</a></li>
<li><a href="search.htm" onClick="return expandcontent('sc4', this)" theme="#DFFFDF">Search</a></li>

Flyguy
11-19-2004, 06:40 AM
i found this about 15 mins ago....

http://dynamicdrive.com/dynamicindex17/switchcontent.htm


I have made it work almost how i want it, but I have 1 weird thing i dont understand, 1 REALLY weird thing happen, and 1 I just need knowledge about.

I replaced <A HREF="home.html" onMouseover = ect ect with ...

<h3 onClick="expandcontent('sc1')" style="cursor:hand; cursor:pointer" onMouseover = "filter('im

Put my Div where i wanted it, all good.... HOWEVER......

Problem (semi weird thing) #1. If i close the </h3> at the end, it makes the buttons misalign and i cant move then at all. But it works perfectly even with 5 open tags!

Problem (REALLY weird thing) #2 ...but i think its realted to 1.... page loads, the first time I click on a "nav" button....and it does its rollover perfectly, pulls up Div correctly... but it SHIFTS my logo.jpg at the top! Just does it 1 time, and then its locked... but it still looks fine.

Problem #2.... I want the page to load with 1 of the Div already being open, like a "home" and heres its content. Right now, I load page, nothing is showing until i push a button. I saw in the script it had this....

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0"
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}

but have no clue what to do

simonf
11-19-2004, 07:09 AM
Hi

Try this.. rgds,Simonf :cool:

<body onload="FP_preloadImgs(/*url*/'button1A.jpg', /*url*/'button1B.jpg')">
<h3 onClick="expandcontent('sc1')" style="cursor:hand; cursor:pointer">
<img border="0" id="img1" src="button19.jpg" height="30" width="150" alt="What is Java Script" fp-style="fp-btn: Embossed Capsule 1" fp-title="What is Java Script" onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'button1A.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'button19.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'button1B.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'button1A.jpg')"></h3>
<div id="sc1" class="switchcontent">
JavaScript is a scripting language originally developed by Netscape to add interactivity and power to web documents. It is purely client side, and runs completely on the client's browser and computer.
</div>

TomH
11-20-2004, 03:24 PM
Hi,

I am not technical but enjoying the learning experience. why is it that when I get one script to work (such as menus etc) and then install another that they effect each other or one stops working?

cr3ative
11-21-2004, 12:40 PM
With menus, it doesn't usually work by default. Ever.

There's a link in my signature *points* which can help you though.

cr3ative

Flyguy
11-21-2004, 02:53 PM
www.reynardmodifications.com

thats the site I am working on for a friend.

The tables wont span column right either. I know the code is sloppy right now. The <h3> tags arent closed, and when I do, it throws the nav bottums off and I cant move them.

any ideas?