Submit articles - Kamala Harris - Debt Consolidation - Wordpress magazine themes - Free Advertising

PDA

View Full Version : onClick iframe assistance for beginner


d360
Apr 23rd 2007, 1:50 pm
Hi all, I hope someone can help me finalize this project.

Here's the site I'm working on: Link (http://www.destination360.com/developer/snoqualmie/vt.html)

The top half of the page (flash panorama + copy) is an iframe, the bottom is a tab interface which allows you to click around independently of the iframe. Links from the map load in the iframe above (iframe name="pano").

However, our client would prefer that when you click on a tab, a new panorama from that new mountain will load above.

I've been in contact with the developer of the tab interface, and he says it's possible to do this with an onClick event and supplied me with this example code:
function(argsObj) {

var t = argsObj.tabber; /* Tabber object */
var id = t.id; /* ID of the main tabber DIV */
var i = argsObj.index; /* Which tab was clicked (0 is the first tab) */
var e = argsObj.event; /* Event object */

var iframe = document.getElementById('myiframeid');

switch (i) {
case 0:
iframe.src = 'url for iframe';
break;
case 1:
iframe.src = 'url for iframe';
break;
case 2:
iframe.src = 'url for iframe';
break;
}
}


Unfortunately, I'm not sure how to implement that (where to put what, what to change, etc)...caue I'm a beginner and I suck ;) For instance, if I put that code in the <head> section (where I *assume* it goes), what do I put for the <a> on each tab? If anyone can show me what to do I'd be very appreciative.

Thanks for any help y'all can provide.

bibel
Apr 25th 2007, 11:40 pm
You don't need an <a> for each tab.
You need to instance an tabberObj object and use and use that as an argument for onclick on every div.

You need too look into some tabber examples.Maybe this helps : http://www.barelyfitz.com/projects/tabber/index.php?printable_version=1&