<body onLoad="init()"> </body>Here is the code from the JavaScript file:
'<div class="menu" style="background-color: #32373c; width: 100%; position: relative; margin: 0 auto; z-index: 1000; height: 100px; cursor: pointer;">' +
'<img src="resources/img/logo.png" style=" padding-left: 50px; padding-top: 20px;">' + '<div class="sub" style="background-color: #32373c; color: #FFF; position: absolute; cursor: pointer; width: 100%; text-align; center; height: 200px; padding: 5px 0 3px; display: none; ">' + '<div class="cdb-toolbar-line2-left">' + '<p style="color: white; padding-top: 10px; padding-right: 10px; float: left">Photos</p>' + '<div style="float: left; padding-top: 2px;"><input type="checkbox" class="switch icons" id="cdb-baseLayer-toggle"></input></div>' + '<p style="color: white; padding-top: 10px; padding-right: 10px; padding-left: 20px; float: left">Persons details</p>' + '<div style="float: left; padding-top: 2px;"><input type="checkbox" class="switch icons" id="cdb-clickInfo-toggle"></input></div>' + '</div>' + '</div>' + '</div>' /* ----- HOVER ----- */
$(function() {
$
(".menu").hover( function() {
$
(".sub").stop().slideToggle(400); },
function() {
$
(".sub").stop().slideToggle(400); }
);
});
/* ----- BUTTON PRESSED ----- */
$('#cdb-baseLayer-toggle').slickswitch
({
toggledOn: function() {
// switched on me.toggleBaseLayer(); },
toggledOff: function() {
// switched off me.toggleBaseLayer(); }
});
$
('#cdb-clickInfo-toggle').slickswitch
({
toggledOn: function() {
// switched on
me.toggleClickInfo(); },
toggledOff: function() {
// switched off
me.toggleClickInfo(); } });
.switch { position: relative; display: inline-block; width: 34px; height: 35px; cursor: pointer; background: url(../img/off_power_button.png) 0 0px no-repeat; }
.switch .ss-on { position: absolute; display: inline-block; width: 34px; height: 35px; background: url(../img/blue_power_button.png) 0 0px no-repeat; }
.switch.icons { background: url(../img/off_power_button.png) 0 0px no-repeat; background-position: 0 0px; }
.
switch.icons .ss-on { background: url(../img/blue_power_button.png) 0 0px no-repeat; }
The switch icons class actually calls the css code above.
sub class belongs to the drop down menu and the remaining code below it belongs to the buttons that appear when the hover kicks in.
Any help is greatly appreciated. Please forgive any errors in my code here. Still familiarizing myself with HTML - CSS - jQuery.
Many thanks.