Click to See Complete Forum and Search --> : Does anyone know how to get this to work?


leonard_770
03-07-2003, 05:07 AM
I'm using a 'scrollit' function that moves a center frame horizontally when you click the menu buttons on the top frame.

The problem is that when you click on the content of this I want to be able to load another page in this center frame, but then when you click the menu buttons on the top frame again I want the main page to re-load into the frame and move to the correct position.

See attached files to better understand what I mean.

Does anyone know how I might acheive this using javascript, (preferbly external js files).

Thanks for your help.

Lenny.

leonard_770
03-07-2003, 06:44 AM
Thanks for your reply Dave,

Do you put this script on the buttons in the top frame?

Excuse my ignorance,

Lenny.

leonard_770
03-10-2003, 09:34 AM
I'm sorry but I can't get this to work.

I have the following code on my buttons at the moment, where do I add your script?

(Target frame = main, href = center.htm)

<a href="javascript:scrollit(1500);" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','b3','images/03.jpg','images/03.jpg',1)" onClick="MM_nbGroup('down','navbar1','b3','images/03.jpg',1);" ><img name="b3" src="images/03.jpg" width="137,5" height="70" border="0"></a>

Thanks for help,

Lenny

leonard_770
03-12-2003, 05:07 AM
Hi again Dave,

I'm sorry to bother you again but I tried this code and all that happens is that the page scrolls to the selected number but then it refreshes and returns to the first number again.

Plus if you click into the section and then click a button on top it just reloads the page at number 1 and doesn't move.

Maybe I'm using the code wrongly, if it's at all possible and you have the time could you please show me how you'd integrate the code into the top.htm.

Thanks very much for your help,

Lenny.

leonard_770
03-12-2003, 10:36 AM
Hi Dave and thanks again for reply.

It's just that I'm designing a page for a spanish design school which you can see on the link below;
http://www.batllegroup.com/clientes/bau/html/launch1.htm

On the main page you click the top menu buttons and the page slides horizontally to that section.
You can then enter the section by clicking on the center frame.

My problem is that I want, when you're in a section, that when you can click a top menu button the main page reloads into the center frame, but it also moves the center frame to the selected section, (750, 1500, etc).

I seen it done on this site;
http://www.csm.linst.ac.uk/silver.html

Thanks again for all you help so far,

Lenny

leonard_770
03-13-2003, 03:45 AM
In which page?

khalidali63
03-13-2003, 07:22 AM
Replace this

MM_nbGroup

function in your top.htm page with this

/* Functions that swaps down images. */
function MM_nbGroup(event, grpName) { //v3.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
if ((nbArr = document[grpName]) != null)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
parent.frames[1].location.href = "center.htm"
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
}



Cheers

Khalid

leonard_770
03-13-2003, 09:52 AM
Hi Khalid, thanks for your reply,

It works, but only in Netscape 7, but not 4 or in internet exporer 5.
(I'm using a macintosh).

The main page scrolls but then after a couple of seconds it refreshes and goes back to number 1 section. When you click into a section and click the top menu again it justs loads the main page at no.1.


Thanks for your help.

Lenny.

khalidali63
03-13-2003, 11:40 AM
Well I had tested it for IE6+ and NS6+,there may be something else in the code.
Anyways

Check this link and see if th works for you,make sure you test it extensively.

http://68.145.35.86/temp/leonard_770/frameset.htm

Cheers

Khalid

leonard_770
03-13-2003, 12:12 PM
Hi Khalid,

I checked this link, the main page scrolls ok, and doesn't time out back ot the no1 section. But when you enter a section and then click a top menu number, the page reloads the main page but it just stays at no1, and doesn't scoll to the selected number.

Thanks anyhow,

Lenny