ciao a tutti.
sto cercando un menu a tendina esattamente di questo tipo....
http://www2.coca-cola.com/
se qualcuno sa batta un colpo.
ciao a tutti.
sto cercando un menu a tendina esattamente di questo tipo....
http://www2.coca-cola.com/
se qualcuno sa batta un colpo.
http://www.gazingus.org/html/menuDropdown.html
prendi il codice della pagina, è lì apposta!
Heaven's closed. Hell sold out.
Linux 2.6.26-2-amd64
Debian squeeze
si ma il discorso è che il menu viene richiamato da un file .js esterno.................e non si ha accesso al file js esterno.
impossibile, in entrambi i casi il percorso del js esterno parte dalla root del sitoOriginariamente inviato da tse
e non si ha accesso al file js esterno.
x es. http://www.gazingus.org/js/menuDropdown.js
ciao
ecco qui i js....
MENU_DATA
var tempCounter=0;
/**
* Menu Data Structures
*
* Menu Record
* [0] = arbitrary, unique, identifier of the menu state. This
* determines which menu element is "active" and which sub
* menus are displayed
* [1] = OPTIONAL(if this is a text menu): Image name and id as
* designated in the img tag
* [2] = OPTIONAL(if this is a text menu): image width
* [3] = OPTIONAL(if this is a text menu): image height
* [4] = OPTIONAL(if this is a text menu): href to the image
* minus the naming convention extensions such as '_dn'
* and the file type. The default menu printing functions
* will create RollOver obejcts according to the '_dn' & '_ro'
* naming convention. All menu graphics are assumed to be gifs.
* [5] = The 'alt' value of an img tag if this is a graphic menu or the
* menu text if this is a text menu
* [6] = The link for this menu option to link to
* [7] = OPTIONAL: An array of nested menu elements. This is used to create
* a single level of nesting on the left nav but it could
* be used to create create tree menus of arbitrary depth
*/
//holds the data for the global links on the top rigth side
var level1MenuOptionsArray = [];
level1MenuOptionsArray[tempCounter++] = [10,'coca_cola_company',124,24,'/images/tmb_company','The Coca-Cola Company','/index.html'];
level1MenuOptionsArray[tempCounter++] = [20,'coca_cola_worldwide', 109, 24, '/images/tmb_intsites', 'Coca-Cola Worldwide','http://www.coca-cola.com/worldwide/'];
level1MenuOptionsArray[tempCounter++] = [30,'coca_cola_in_the_usa', 110, 24, '/images/tmb_cocausa', 'Coca-Cola in the USA','http://www.coca-cola.com/usa/'];
tempCounter=0;
//holds the data for the main menu
var level2MenuOptionsArray = [];
level2MenuOptionsArray[tempCounter++] = [10,'our_company', 81, 21, '/images/tmb_compa', 'our company','/ourcompany/index.html'];
level2MenuOptionsArray[tempCounter++] = [20,'citizenship',63,21,'/images/tmb_citiz','citizenship','/citizenship/index.html'];
level2MenuOptionsArray[tempCounter++] = [30,'brand',47,21,'/images/tmb_brands','brands','/brands/index.html'];
level2MenuOptionsArray[tempCounter++] = [40,'investors',57,21,'/images/tmb_invest','investors','/investors/index.html'];
level2MenuOptionsArray[tempCounter++] = [50,'press_center',71,21,'/images/tmb_press','press center','/presscenter/index.html'];
level2MenuOptionsArray[tempCounter++] = [60,'careers',49,21,'/images/tmb_carrer','careers','/careers/index.html'];
level2MenuOptionsArray[tempCounter++] = [70,'contact_us',66,21,'/images/tmb_contac','contact us','/contactus/index.html'];
<!--
/**
* Creates RollOver objects that preload their rollover image.
* You do not need to add menu rollovers to this list,
* the menu code Creates it's own
*
* The rollover record:
* [0] = the name or ID of the image object as it
* appears in the img tag.
* [1] = the normal image
* [2] = the image that is displayed when the mouse is over
*/
var roc=0;
var rollOverArray = [];
rollOverArray[roc++] = ['site_map','/images/b_sitemap.gif','/images/b_sitemap_ro.gif'];
rollOverArray[roc++] = ['store','/images/b_store.gif','/images/b_store_ro.gif'];
rollOverArray[roc++] = ['go_button','/images/b_go.gif','/images/b_go_ro.gif'];
rollOverArray[roc++] = ['printable','/images/printable_version.gif','/images/printable_version_ro.gif'];
rollOverArray[roc++] = ['viewall','/presscenter/img/viewall.gif','/presscenter/img/viewall_on.gif'];
rollOverArray[roc++] = ['promolink','/images/promolink_up.gif','/images/promolink_up_on.gif'];
Heaven's closed. Hell sold out.
Linux 2.6.26-2-amd64
Debian squeeze
var debug = false;
var bNewWindow = false;
var wtl_loc = document.URL.indexOf('https:')==0?'https://a248.e.akamai.net/v/248/2120/1d/download.akamai.com/crs/lgsitewise.js':'http://crs.akamai.com/crs/lgsitewise.js';
var wtl_TagVer = 6;
var wtl_FWD = 0;
//var wtl_url = document.URL;
var wtl_url = "http://www.coca-cola.com/";
var wtl_title = document.title;
var wtl_TagID = 104655;
var wtl_SID = "005-01-9-20-233860-104655";
var wtl_Offset = "-500";
WTL_TAG = new Image;
WTL_TAG.ID = "WTL_TAG";
var ORDER= "";
var SERVER= "";
var INVOICE= "";
var CARTVIEW= "";
var CARTADD= "";
var CARTREMOVE= "";
var CHECKOUT= "";
var CARTBUY= "";
var ADCAMPAIGN= "";
// These variables can be set by calling modules to override the popup window properties.
var newWindowProps = "";
var newWindowName = "";
var sContentGroup = "Corporate";
function navigate (sUrl, bNewWindow, sSubContentGruop, targetWin) {
if (debug == true) alert( "Navigate : '" + sUrl + "'," + bNewWindow + ",");
if ( targetWin == null ) targetWin = top;
// First do the navigation
if (sUrl.length > 0) {
if (bNewWindow == true || bNewWindow == "true") {
window.open(sUrl, "popup", "width=740,height=520,status=yes,toolbar=yes,menub ar=yes,scrollbars=yes,directories=yes,location=yes ,resizable=yes");
} else {
targetWin.location = sUrl;
}
}
doTracking (sSubContentGruop, targetWin);
}
function doTracking (sSubContentGruop) {
if (debug == true) alert( "Tracking : " + sContentGroup + "," + sSubContentGruop );
// then call the wtl_Tag6
wtl_Tag6(wtl_TagID, wtl_SID, wtl_url, wtl_title, sContentGroup + "," + sSubContentGruop);
//wtl_Tag6(wtl_TagID,wtl_SID,wtl_url,wtl_title);
}
function popupSiteMap() {
var newWindowProps1 = "width=784,height=479,status=no,toolbar=no,menubar =no,scrollbars=1,resizable=no";
var newWindowName1 = "SiteMap";
var sUrl = "/sitemap/index.html";
parent.open (sUrl, newWindowName1, newWindowProps1);
doTracking ("Site Map");
}
function store() {
var newWindowProps1 = "width=780,height=480,status=yes,menubar=yes,toolb ar=yes,resizable=yes,scrollbars=yes,location=yes";
var newWindowName1 = "store";
var sUrl = "http://www.coca-colastore.com";
parent.open (sUrl, newWindowName1, newWindowProps1);
doTracking ("Store");
}
function navigateBack() {
history.back();
doTracking ("Corporate", "Back");
}
var pageRollOvers = [];
var rollOverCounter = 0;
/**
* Called by document.onLoad to create the rollover objects
* Createing a rollover object cause it's on image to be
* preloaded
*
* @param rollOverArray - an array of rollovers records in the form:
* [0] = the name/id of the image object as is in the img tag
* [1] = the off rollover image href
* [2] = the on rollover image href
*/
function createRollOvers(rollOverArray)
{
for (var i=0; i<rollOverArray.length; i++)
addRollOver(new RollOver(rollOverArray[i][0], rollOverArray[i][1], rollOverArray[i][2]));
}
/**
* helper for createRollOvers
*/
function addRollOver(rollOver){ pageRollOvers[rollOverCounter++] = rollOver;}
/**
* used by the anchor tags onMouseOver and onMouseOut calls
* to retrieve the RollOver object that you can call rollOn()
* or rollOff on
*
* @param rolloverName - the name/id of the img href associate
* with a rollover
*
* @return a RollOver object
*/
function getRollOver(rollOverName)
{
for (var i=0; i<rollOverCounter; i++)
{
if (pageRollOvers[i].imageObject == rollOverName)
return pageRollOvers[i];
}
return null;
}
/**
* RollOver object, a simple object that can toggle
* the src of an ImageObject
*
* @param imgObject - the name/id of the image as it
* appears in the img tag
* @param offImageSrc - the href of the off state image
* @param onImageSrc - the href of the on state image
*/
function RollOver(imgObject, offImageSrc, onImageSrc)
{
//preload rollover images
this.preLoadOnImg = new Image();
this.preLoadOnImg.src = onImageSrc;
//object properties
this.imageObject = imgObject;
this.offImageSrc = offImageSrc;
this.onImageSrc = onImageSrc;
//object methods
this.rollOn = RollOver_rollOn;
this.rollOff = RollOver_rollOff;
}
function RollOver_rollOn(){ var img = DOMGetElement(this.imageObject); if (img)img.src=this.onImageSrc;}
function RollOver_rollOff(){ var img = DOMGetElement(this.imageObject); if (img)img.src=this.offImageSrc;}
/**
* Menu Data Structures
*
* Menu Record
* [0] = arbitrary, unique, identifier of the menu state. This
* determines which menu element is "active" and which sub
* menus are displayed
* [1] = OPTIONAL(if this is a text menu): Image name and id as
* designated in the img tag
* [2] = OPTIONAL(if this is a text menu): image width
* [3] = OPTIONAL(if this is a text menu): image height
* [4] = OPTIONAL(if this is a text menu): href to the image
* minus the naming convention extensions such as '_dn'
* and the file type. The default menu printing functions
* will create RollOver obejcts according to the '_dn' & '_ro'
* naming convention. All menu graphics are assumed to be gifs.
* [5] = The 'alt' value of an img tag if this is a graphic menu or the
* menu text if this is a text menu
* [6] = The link for this menu option to link to
* [7] = OPTIONAL: An array of nested menu elements. This is used to create
* a single level of nesting on the left nav but it could
* be used to create create tree menus of arbitrary depth
*/
/**
* Menu Object, prints out a menu based on the above menu data structure.
* The menus were done in an object oriented way to maximize flexibility
* and reusability of functions. LeftNavMenu modifies the behavior
* of Menu by using a different printMenuOption method
*
* @param inMenuOptions = an array of menu options. Eacy array
* element is a 7 element list as outlined above
* @param choice = an indicator of the current page. The
* choice will be compared against the first element
* of each menu option record.
* @returns an initialized menu object that can print a menu
*/
function Menu(inMenuOptions, choice)
{
//Object Properties
this.menuOptions = inMenuOptions
this.choice = choice;
//Object Functions
this.print = Menu_Print;
this.printMenuOption = Menu_PrintMenuOption;
this.optionSelected = Menu_optionSelected;
}
/**
* Used by menu objects to loop over an array of menu
* option arrays...to loop over each menu choice and
* have a replaceable helper function print out the
* menu line item. A helper function does the printing
* so that the object can switch out the function to
* print differet types of menus
*/
function Menu_Print()
{
for (var i=0; i<this.menuOptions.length; i++)
this.printMenuOption(this.menuOptions[i], this.choice1);
}
/**
* Seaches a menuOption and it's sub menus (contained in an
* array in item [7], for a menu option that has matches
* this objects currently selected option. The function
* is recursive and work for an menu structure of
* arbitrary depth.
*
* @param the record to search fro this.choice
*/
function Menu_optionSelected(menuOption)
{
if (menuOption[0] == this.choice)
return true;
else if (menuOption[7]!=null)
for (var i=0; i<menuOption[7].length; i++)
if (this.optionSelected(menuOption[7][i]))
return true;
return false;
}
/**
* This method is designed to print out each
* option in a graphical horizontal menu
*/
function Menu_PrintMenuOption(menuOption)
{
if (this.optionSelected(menuOption))
{
if (NS4)
{
document.write('<td><a href="'+menuOption[6]+'">');
document.write('[img]'+menuOption[4]+'_dn.gif[/img]</a></td>');
}
else
{
document.write('<td><a href="javascript:navigate(\'' + menuOption[6] + '\', false, \'' + menuOption[1] + '\', top)" onMouseOver="'+menuOption[1]+'_am.hideSubMenu(); '+menuOption[1]+'_am.show(); '+menuOption[1]+'_am.activeColor();" onMouseOut="'+menuOption[1]+'_am.menubar.startTimer(); '+menuOption[1]+'_am.normalColor();">');
document.write('[img]'+menuOption[4]+'_dn.gif[/img]</a></td>');
}
}
else
{
if (NS4)
{
addRollOver(new RollOver(menuOption[1], menuOption[4]+'.gif', menuOption[4]+'_ro.gif'));
document.write('<td><a href="'+menuOption[6]+'" onMouseOut="getRollOver(\'' + menuOption[1] + '\').rollOff();" onMouseOver="getRollOver(\'' + menuOption[1] + '\').rollOn();">');
document.write('[img]'+menuOption[4]+'.gif[/img]</a></td>');
}
else
{
addRollOver(new RollOver(menuOption[1], menuOption[4]+'.gif', menuOption[4]+'_ro.gif'));
document.write('<td><a href="javascript:navigate(\'' + menuOption[6] + '\', false, \'' + menuOption[1] + '\', top)" onMouseOut="getRollOver(\'' + menuOption[1] + '\').rollOff(); '+menuOption[1]+'_am.menubar.startTimer(); '+menuOption[1]+'_am.normalColor();" onMouseOver="getRollOver(\'' + menuOption[1] + '\').rollOn(); '+menuOption[1]+'_am.hideSubMenu(); '+menuOption[1]+'_am.show(); '+menuOption[1]+'_am.activeColor();">');
document.write('[img]'+menuOption[4]+'.gif[/img]</a></td>');
}
}
}
/**
* A specialization of the Menu object that replaces
* the printmenuOptions method with one that is
* designed to print out a vertical text based menu
*
* @param inMenuOptions = an array of menu options. Eacy array
* element is a 7 element list as outlined above
* @param choice = an indicator of the current page. The
* choice will be compared against the first element
* of each menu option record.
* @returns an initialized menu object that can print a menu
*/
function LeftNavMenu(inMenuOptions, choice)
{
//data
this.menuOptions = inMenuOptions
this.choice = choice;
//functions
this.print = Menu_Print;
this.optionSelected = Menu_optionSelected;
this.printMenuOption = LeftNavMenu_printMenuOption;
this.printSubOptions = LeftNavMenu_printSubOptions;
}
/**
* Prints a vertical text tree menu.
*
* TODO-make the output routine and table structure
* support arbitrary nesting depths
*/
function LeftNavMenu_printMenuOption(menuOption)
{
if (this.optionSelected(menuOption))
{
if ( menuOption[ 7])
{
document.write('<tr><td valign="top" width="8%">[img]/images/navtree_arrow_dn.gif[/img]</td><td class="copy-navtree" width="92%">'+menuOption[5]+'</td></tr>');
document.write('<tr><td></td><td><table border=0 cellspacing=0 cellpadding=0>');
this.printSubOptions(menuOption);
document.write('</table></td></tr>');
}
else
document.write('<tr><td valign="top" width="8%">[img]/images/navtree_arrow_active.gif[/img]</td><td class="copy-navtree" width="92%">'+menuOption[5]+'</td></tr>');
}
else
{
document.write('<tr><td valign="top" width="8%">[img]/images/navtree_arrow.gif[/img]</td>');
document.write('<td class="copy-navtree" width="92%">'+menuOption[5]+'</td></tr>');
}
}
function LeftNavMenu_printSubOptions(menuOption)
{
for (var i=0; i<menuOption[7].length; i++)
{
//debug(menuOption[7][i]);
if (this.optionSelected(menuOption[7][i]))
{
document.write('<tr><td class="copy-navtree-on" valign="top" width="10%"> </td>');
document.write('<td class="copy-navtree-on" valign="middle" width="90%"> '+menuOption[7][i][5]+'</td></tr>');
}
else
{
document.write('<tr><td class="copy-navtree" width="10%" valign="top">· </td>');
document.write('<td class="copy-navtree" width="90%">'+menuOption[7][i][5]+'</td></tr>');
}
}
}
Heaven's closed. Hell sold out.
Linux 2.6.26-2-amd64
Debian squeeze
/**
* Menu printing functions.
* Call each function where the menu should be printed out.
* the identifier of the current page should be passed into the call
*
* The data that drives the menus and sets up the page identifiers
* should b passed in in the menu_data.js file
*/
function printLevel1Menu(currentPage){new Menu(level1MenuOptionsArray, currentPage).print();}
function printLevel2Menu(currentPage){new Menu(level2MenuOptionsArray, currentPage).print();}
function printLevel3Menu(currentPage){new LeftNavMenu(level3MenuOptionsArray, currentPage).print();}
function sitemap()
{
var url = '/sitemap/index.html';
openPopup(url, 'sitemap', 'width=770,height=480,status=no,menubar=no,toolbar =no,resizable=no,scrollbars=no,location=no');
}
function print(url)
{
openPopup(url,'print','width=520,height=400,status =no,menubar=yes,toolbar=yes,resizable=yes,scrollba rs=yes,location=no');
}
function openPopup(url, name, style)
{
/*
toolbar[=yes|no]|[=1|0] location[=yes|no]|[=1|0] directories[=yes|no]|[=1|0] status[=yes|no]|[=1|0] menubar[=yes|no]|[=1|0] scrollbars[=yes|no]|[=1|0] resizable[=yes|no]|[=1|0] width=pixels height=pixels
*/
//so each window can be unique
if (!name) name = new Date().getTime() + '';
if (!style)
style = 'width=520,height=400,status=yes,menubar=no,toolba r=no,resizable=no,scrollbars=yes,location=no';
var popupWindow = window.open(url,name,style);
popupWindow.focus();
}
function gothere() {
window.location=document.sel.edu.options[document.sel.edu.selectedIndex].value
}
function timeline(val) { var timelineWin = window.open(val, 'timeline', 'width=790,height=500,toolbar=no,scrollbars=no,men ubar=no,left=30,top=30,resizeable=no,directories=n o') }
function popupVPT(val) { var popupVPT = window.open(val, 'popupVPT', 'width=727,height=557,toolbar=no,scrollbars=no,men ubar=no,left=30,top=30,resizeable=no,directories=n o') }
function youth(val) { var youthWin = window.open(val, 'youth', 'width=770,height=500,toolbar=yes,scrollbars=yes,m enubar=yes,left=30,top=30,resizeable=yes,directori es=no') }
function askcokepopup() { var askpopupWin = window.open('http://questions.coca-cola.com', 'askcoke', 'width=520,height=400,toolbar=no,scrollbars=yes,me nubar=no,left=30,top=30,resizeable=no') }
function popup(val) { popupWin = window.open(val, 'popup','width=520,height=400,scrollbars=yes,menub ar=yes,left=30,top=30,resizeable=no') }
Heaven's closed. Hell sold out.
Linux 2.6.26-2-amd64
Debian squeeze
fato fatto.
basta dare un semplice save as dal browser che salva anche il file js esterno.
dhangs, bye.
già!!!
![]()
cmq prego
![]()
Heaven's closed. Hell sold out.
Linux 2.6.26-2-amd64
Debian squeeze