soundmap_theme/js/soundmap_theme.js

77 lines
2.4 KiB
JavaScript
Executable File

jQuery("document").ready(function(){
//Executes when ready.
//console.log("Template: "+WP_Params);
var doc_height = jQuery(window).height();
var bar_height = jQuery(".menu-header").outerHeight(true);
jQuery("#main-content").height(doc_height-bar_height);
jQuery(window).resize(function() {
jQuery("#main-content").height(jQuery(window).height()-bar_height);
});
jQuery('.home .slider-button>a').click(function(event){
event.preventDefault();
referencia = jQuery(this).attr("rel");
jQuery(".visible-page").slideUp().removeClass("visible-page");
jQuery('#post-' + referencia).slideDown().addClass("visible-page");
});
jQuery(".folding-sidebar h3").click(function(){
/* padre = jQuery(this.parentElement);
jQuery("ul, form", padre).slideToggle();
jQuery(this).toggleClass("arrow-right");*/
jQuery(this).next().slideToggle();
jQuery(this).toggleClass("arrow-right");
});
jQuery(".marker-links-js").click(function(event){
event.preventDefault();
referencia = jQuery(this).attr("rel");
var marker = jQuery('.map_canvas').gmap('get', 'markers')[referencia];
google.maps.event.trigger(marker, "click");
});
//tb_init('li.thickbox>a[rel="addnewfile"]');
});
function onMapFinished (map){
//console.log("map finished");
// Create the DIV to hold the control and call the HomeControl() constructor
// passing in this DIV.
var homeControlDiv = document.createElement('DIV');
var homeControl = new HomeControl(homeControlDiv, map);
homeControlDiv.index = 1;
//map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(homeControlDiv);
}
function HomeControl(controlDiv, map) {
// Set CSS styles for the DIV containing the control
// Setting padding to 5 px will offset the control
// from the edge of the map
controlDiv.style.padding = '5px';
// Set CSS for the control border
var controlUI = document.createElement('DIV');
controlUI.id = "fullscreen";
controlUI.title = 'Fullscreen';
controlDiv.appendChild(controlUI);
// Setup the click event listeners: simply set the map to Chicago
/*google.maps.event.addDomListener(controlUI, 'click', function() {
jQuery("#left").toggleClass('map-fullscreen');
google.maps.event.trigger(g_map, 'resize')
g_map.setCenter(or_latln);
});*/
}