JavaScript - How To Refresh Google Map Inside A Control Panel ?
Similar TutorialsGuy help me for the solution... how to refresh the markers only every x... below are my full scripts.... Code: <?php define('INCLUDE_CHECK',1); include "dbconnect.php"; ?> <!DOCTYPE html> <html lang="en"> <head> <script type="text/javascript" src="host_entry/js/jquery-1.7.1.min.js"></script> <!-- Google Map JS --> <script src="http://maps.google.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false" type="text/javascript"></script> </head> <div id="map_canvas" style="top:55px;left:13px;"> <!-- Map will display --> <div id="map"> <!-- Fullscreen Loading & Fullscreen Buttons area --> </div> <!-- Fullscreen Loading & Fullscreen Buttons area Ends --> </div><!-- Map Ends display --> <script type="text/javascript"> /**function show_data() { $('#map').load('index.php'); } setInterval('show_data()', 60000); **/ var locations = [ <?php $query="SELECT * from host_entry"; $result=mysql_query($query)or die(mysql_error()); { if ($num=mysql_numrows($result)) { $i=0; while ($i < $num) { $id=mysql_result($result,$i,"id"); //$host_type=mysql_result($result,$i,"host_type"); $host_name=mysql_result($result,$i,"host_name"); $host_server=mysql_result($result,$i,"host_server"); $host_status=mysql_result($result,$i,"host_status"); $host_lapt=mysql_result($result,$i,"host_lapt"); $host_long=mysql_result($result,$i,"host_long"); $host_circuit=mysql_result($result,$i,"host_circuit"); $host_hotline=mysql_result($result,$i,"host_hotline"); if($host_status==0) echo "['<div class=container style=width:400px;><div class=page-header><h4>$host_name</h4></div>', $host_lapt, $host_long],"; $i++; } }else { echo "<h3 align='center'><font color='#ff0000'>No Content Found</font></h3>"; } } ?> ]; // Setup the different icons and shadows var iconURLPrefix = 'host_entry/img/'; var icons = [ iconURLPrefix + 'p_red_alert.png' ] var icons_length = icons.length; var map = new google.maps.Map(document.getElementById('map'), { zoom: -5, center: new google.maps.LatLng(3.1215681, 101.71180140000001), mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false, streetViewControl: false, disableDefaultUI: true, panControl: false, zoomControlOptions: { position: google.maps.ControlPosition.LEFT_BOTTOM } }); var marker; var markers = new Array(); var iconCounter = 0; var infowindow = new google.maps.InfoWindow({ maxWidth: 400, maxHeight: 350, }); // Add the markers and infowindows to the map for (var i = 0; i < locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2], locations[i][3], locations[i][4], locations[i][5]), map: map, animation: google.maps.Animation.BOUNCE, icon : icons[iconCounter], }); markers.push(marker); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent( locations[i][0] ); infowindow.open(map, marker); setTimeout(function(){infowindow.close();}, '5000'); } })(marker, i)); iconCounter++; // We only have a limited number of possible icon colors, so we may have to restart the counter if(iconCounter >= icons_length){ iconCounter = 0; } } function AutoCenter() { // Create a new viewpoint bound var bounds = new google.maps.LatLngBounds(); // Go through each... $.each(markers, function (index, marker) { bounds.extend(marker.position); }); // Fit these bounds to the map map.fitBounds(bounds); } AutoCenter(); </script> </body> </html> do i need to apply setInterval on the marker? how to apply it on the marker so it refresh every X second... please help for the solution.... Hi everyone, I'm putting together a family tree type organization chart and looking to be able to drag it around to view different parts similar to google maps. I believe javascript is the way to handle this but need some help pointing me in the right direction. Any help would be greatly appreciated. Thanks, Mike Hi, Apologies in advance but I have no experience of Javascript. I found the following 'Cut & Paste Google Internal Site Search script' in the Javascriptkit.com library - it works well and provides an easy solution for adding a search function to a website - code below Code: <script type="text/javascript"> // Google Internal Site Search script- By JavaScriptKit.com (http://www.javascriptkit.com) // For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/ // This notice must stay intact for use //Enter domain of site to search. var domainroot="www.javascriptkit.com" function Gsitesearch(curobj){ curobj.q.value="site:"+domainroot+" "+curobj.qfront.value } </script> <form action="http://www.google.com/search" method="get" onSubmit="Gsitesearch(this)"> <p>Search JavaScript Kit:<br /> <input name="q" type="hidden" /> <input name="qfront" type="text" style="width: 180px" />*<input type="submit" value="Search" /></p> </form> <p style="font: normal 11px Arial">This free script provided by<br /> <a href="http://www.javascriptkit.com">JavaScript Kit</a></p> However, if possible, I would like to display the results inside the website structure rather than on a new page - is there an easy way to do this? Thanks in advance for any help. Help will be greatly appreciated! Situation: I have a very long page divided into many sections vertical-wise marked by bookmarks, say pageX.html#s1 to s10. I need to show the section inside an iframe (iFrame1) on the mainpage (mainpage.html). I am thinking of having 4 buttons, sitting on the mainpage, to help navigate between these sections on pageX, namely NEXT, PREVIOUS, TOP, END. condition of the frame, fixed width/height, no scroll, no border. Very new to javascript but need this code to make a page work for BIZ. Thank you in advance for anyone kind enough to point the right direction! Hi, I have the below code: Code: <script type="text/javascript"> function loadQuickMessageCheck(File,ID){ var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(ID).innerHTML=xmlhttp.responseText; eucalyptus = setInterval(function(){loadQuickMessageCheck(File,ID)},20000); } } xmlhttp.open("POST",File,true); xmlhttp.send(); } </script> But I am overloading the server and crashing it. I've googled the issue and have found people with similar problems who talk about the need to cancel the last refresh request before they send the next refresh. I even found this nice piece of code which worked for someone else. Quote: try{window.clearTimeout(tRefresh)} catch(err) {} tRefresh = setInterval(setContext, varInterval*60*1000); } I am not sure if this is the solution that I am looking for but if it is all my attempts at applying this code has been a bit of a disaster. helo, i just want to know how to add the same panel by clicking on a button right below the button.. I have a page with a GoogleMap with a GoogleBar and I would like the GoogleBar to appear with something written in it already and to have that search executed. In other words, I would like to "write something to the GoogleBar and press Enter" automatically as soon as the map loads. How can I do this? btw: By GoogleBar, I mean the search bar that appears on the map after using the enableGoogleBar() function. Hello. I've created this sliding panel where I click the Sidebar button and it slides out or in. But I would like to make it run more smoothly. I tried storing references to the elements within the MoveSidebar() as this.variables, so that they wouldn't be re-defined each time, but then FF spits out that 'this.sidebar.style' is undefined?! How can I make it run more smoothly, or get FF to recognise 'this.sidebar.style' please (once I reinstate all the this.references)? Here's the whole page and the button is also attached for ease of testing. Andy. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Sidebar Panel</title> <style type="text/css"> #sidebar { display: inline-block; position: fixed; top: 200px; right: -100px; } #sidebar img { cursor: pointer; } #sidebar ul { display: inline-block; list-style-type: none; padding: 0; margin: 0; background: lightgrey; margin-left: -4px; height: 97px; /* same as the image */ } #sidebar li { display: inline; } #sidebar a { float: left; clear: left; width: 90px; text-decoration: none; padding: 2px 5px; } </style> <script type="text/javascript"> var theTimer; function MoveSidebar() { var sidebar = document.getElementById('sidebar'); var sideRight = parseInt(sidebar.style.right || "-100px"); var out = document.getElementById('sideImage').out; if ( out && sideRight <= 0 ) { sidebar.style.right = (sideRight + 2) + 'px'; } else if ( !out && sideRight >= -100 ) { sidebar.style.right = (sideRight - 2) + 'px'; } else { clearInterval(theTimer); } } function InitSide() { document.getElementById('sideImage').onclick = function () { this.out = ( this.out ) ? false : true; clearInterval(theTimer); theTimer = setInterval(MoveSidebar,10); } } window.onload = InitSide; </script> </head> <body> <h1>Creating a Sidebar Panel Button</h1> <div id="sidebar"> <img src="images/sidebar.png" id="sideImage"> <ul> <li><a href="#home">Home</a></li> <li><a href="#about">About</a></li> <li><a href="#further">Further Info</a></li> <li><a href="#contact">Contact Us</a></li> </ul> </div> </body> </html> hi i was wondering if anybody outhere could refer me to a tut that show how to create a drop down login panel.I've read any tut about drop down from DynamicDrive.com but it's not really what i'm looking forward.I try to change the content in "Drop Down Panel" script released into the relevant tut but it's not working.So help will be welcome. I'm trying to create a menu navigation system from the top of the page. I want it so when I hover over the link, it drops down (the link drops down; so it'd be as if there was a whole field being hidden beyond the 0px mark) with the related field. I've gotten it to work, somehow but it still isn't right. A few issues a - when I hover over .drop_slide and then if I choose to close it by hovering back over the .drop_slide it does as it's told, which is "slide, slide". I'm interested in rectifying this issue so it doesn't do that, however I just don't know how. - The idea is to have multiple links in the .slide, so I need it to be constantly open while the user mouses over the other links. Should this be created in one field? If so, how would I do that with a drop down in mind? - Am I approaching this completely wrong? Lol. Should I be researching into .animate? I've been looking at it actually, but I can't get anything to grow negatively. Say; marginTop: -85px or something. ANY help is appreciated, thanks! Code: <html> <head> <title>test slide panel</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ function slide() { $("#panel").slideToggle("slow"); } $(".drop_slide").hover(slide, stop); $("#panel").hover(stop, slide); }); </script> <style type="text/css"> body { margin: 0 auto; padding: 0; width: 570px; font: 75%/120% Arial, Helvetica, sans-serif; } a:focus { outline: none; } #panel { background: grey; height: 200px; display: none; } .slide { margin: 0; padding: 0; background-color: red; } .drop_games { width: 200px; height: 31px; padding: 10px 10px 0 0; display: block; font: bold 120%/100% Arial, Helvetica, sans-serif; color: #fff; text-decoration: none; } </style> </head> <body> <div id="panel"> additional links here...or information </div> <p class="slide"><a href="#" class="drop_slide">test link</a></p> </body> </html> Hello, trying to cooperate with Spry atm, and its going fairly ok.. Its just one thing, i would like it when you open one spry panel, the rest of them would close. Anyone know how to do that? Thanks First, here's the URL of the site I'm working on: http://www.georgiadogs.com/fls/8800/meetcentral2010/ Each week, I'd like to be able to have that page load a different tab/panel onload according to who the opponent is that week. For example: this week I want the second tab, Alabama, to load first. I'm using one of the many iterations of the coda slider script (see coda-slider.js). However, I can't seem to get it to cooperate. I found a solution for a similar coda slider, but it won't match with the one I'm using (because the naming conventions for the "panels" are not the same I assume). Here's what that solution was: Code: $().ready(function() { $('#coda-slider-6').codaSlider({ crossLinking: false, firstPanelToLoad: 3 }); }); Anyone got any ideas? It doesn't matter to me if the panel just loads from the get-go, or if it loads the first one and then automatically slides to the one I want. Thanks for the help! I'm using a script for a drop down panel and it works fine, however I need to add a bit of a margin for the inner content but the script seems to be stripping it out in firefox, it works fine in ie and chrome. I've tried every trick in the book outside of editing the actual js file. I currently have a transparent image as a spacer at the top and it even ignores that. It seems that firefox just wont display anything above the first form field for some reason. Could someone take a look at this script quick and give me an idea on what to change to I can add like a 5px margin to the top of the content? Code: //** DD Drop Down Panel- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com //** Oct 21st, 08'- Script created //** March 23rd, 09' v1.01- Arrow images now preloaded function ddpanel(setting){ setting.dir="up" //initial state of panel (up="contracted") if (setting.stateconfig.persiststate && ddpanel.getCookie(setting.ids[0])=="down"){ setting.dir="down" } if (setting.dir=="up"){ //if "up", output CSS to hide panel contents document.write('<style type="text/css">\n') document.write('#'+setting.ids[1]+'{height:' + parseInt(setting.stateconfig.initial) + 'px; overflow:hidden}\n') document.write('</style>\n') } setting.stateconfig.initial=parseInt(setting.stateconfig.initial) this.setting=setting if (setting.pointerimage.enabled){ //preload images var img1=new Image(), img2=new Image() img1.src=setting.pointerimage.src[0] img2.src=setting.pointerimage.src[1] } var thispanel=this if (window.addEventListener) //if non IE browsers, initialize panel window.onload ddpanel.addEvent(window, function(e){thispanel.initpanel(setting)}, "load") else //else if IE, add 100 millisec after window.onload before initializing ddpanel.addEvent(window, function(e){setTimeout(function(){thispanel.initpanel(setting)}, 100)}, "load") ddpanel.addEvent(window, function(e){thispanel.uninit(setting)}, "unload") } ddpanel.events_array=[] //object array to contain events created by script ddpanel.addEvent=function(target, functionref, tasktype){ var evtmodel=target.addEventListener? "w3c" : "ie" var evtaction=evtmodel=="w3c"? "addEventListener" : "attachEvent" var i=this.events_array.push({ //store event info in ddpanel.events_array[] and return current event's index within array target: target, tasktype: (evtmodel=="ie"? "on" : "")+tasktype, listener: evtmodel=="ie"? function(){return functionref.call(target, window.event)} : functionref })-1 target[evtaction](this.events_array[i].tasktype, this.events_array[i].listener, evtmodel=="w3c"? false : null) } ddpanel.removeEvent=function(target, functionref, tasktype){ var evtmodel=target.removeEventListener? "w3c" : "ie" var evtaction=evtmodel=="w3c"? "removeEventListener" : "detachEvent" target[evtaction](tasktype, functionref, evtmodel=="w3c"? false : null) } ddpanel.getCookie=function(Name){ var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair if (document.cookie.match(re)) //if cookie found return document.cookie.match(re)[0].split("=")[1] //return its value return null } ddpanel.setCookie=function(name, value){ document.cookie = name+"=" + value + ";path=/" } ddpanel.addpointer=function(target, className, imagesrc){ var pointer=document.createElement("img") pointer.src=imagesrc pointer.className=className pointer.style.borderWidth=0 target.appendChild(pointer) return pointer } ddpanel.prototype={ togglepanel:function(dir){ //public function that toggles the panel's state. Optional dir parameter ("up" or "down") to explicitly set state. var setting=this.setting setting.dir=dir || ((setting.dir=="up")? "down" : "up") var pcontent=setting.pcontent, dir=setting.dir pcontent._currentheight=(dir=="down")? pcontent._actualheight : setting.stateconfig.initial pcontent.style.height=pcontent._currentheight+"px" if (setting.pointerimage.enabled){ setting.arrow.src=setting.pointerimage.src[(setting.dir=="down")? 1 : 0] setting.arrow.style.visibility="visible" } ddpanel.setCookie(setting.ids[0], setting.dir) }, togglepanelplus:function(dir){ //public function that toggles the panel's state w/ animation. Optional dir parameter ("up" or "down") to explicitly set state. var setting=this.setting setting.dir=dir || ((setting.dir=="up")? "down" : "up") if (setting.pointerimage.enabled) setting.arrow.style.visibility="hidden" clearTimeout(setting.revealtimer) this.revealcontent() }, revealcontent:function(){ var setting=this.setting var pcontent=setting.pcontent, curH=pcontent._currentheight, maxH=pcontent._actualheight, minH=setting.stateconfig.initial, steps=setting.animate.steps, dir=setting.dir if (dir=="down" && curH<maxH || dir=="up" && curH>minH){ var newH = curH + (Math.round((maxH-curH)/steps)+1) * (dir=="up"? -1 : 1) newH=(dir=="down")? Math.min(maxH, newH) : Math.max(minH, newH) pcontent.style.height=newH+"px" pcontent._currentheight=newH } else{ if (setting.pointerimage.enabled){ setting.arrow.src=setting.pointerimage.src[(setting.dir=="down")? 1 : 0] setting.arrow.style.visibility="visible" } return } var thispanel=this setting.revealtimer=setTimeout(function(){thispanel.revealcontent()}, 10) }, initpanel:function(){ var setting=this.setting var pcontainer=setting.pcontainer=document.getElementById(setting.ids[0]) var pcontent=setting.pcontent=document.getElementById(setting.ids[1]) var tdiv=setting.tdiv=document.getElementById(setting.ids[2]) pcontent.style.overflow="scroll" pcontent._actualheight=pcontent.scrollHeight setTimeout(function(){pcontent._actualheight=pcontent.scrollHeight}, 100) pcontent.style.overflow="hidden" pcontent._currentheight=(setting.dir=="down")? pcontent._actualheight : setting.stateconfig.initial var thispanel=this ddpanel.addEvent(tdiv, function(e){ //assign click behavior when toggle DIV tab is clicked on if (setting.animate.enabled) thispanel.togglepanelplus() else thispanel.togglepanel() if (e.preventDefault) e.preventDefault() return false }, "click") if (setting.pointerimage.enabled){ var pointer1=new Image(), pointer2=new Image() pointer1.src=setting.pointerimage.src[0] pointer2.src=setting.pointerimage.src[1] setting.arrow=ddpanel.addpointer(tdiv.getElementsByTagName("span")[0], "pointerimage", setting.pointerimage.src[setting.dir=="down"? 1:0]) } if (setting.closepanelonclick.enabled){ //assign click behavior when panel content is clicked on (links within panel or elements with class "closepanel" ddpanel.addEvent(pcontent, function(e){ var rel="nofollow" target=e.srcElement || e.target if (/(^|\s+)closepanel($|\s+)/.test(target.className) || target.tagName=="A" || (target.parentNode && target.parentNode.tagName=="A")){ thispanel.togglepanel("up") } }, "click") } }, uninit:function(){ var setting=this.setting if (setting.stateconfig.persiststate){ ddpanel.setCookie(setting.ids[0], setting.dir) } for (prop in setting){ setting[prop]=null } } } //end of ddpanel object //initialize instance of DD Drop Down Panel: var defaultpanel=new ddpanel({ ids: ["mypanel", "mypanelcontent", "mypaneltab"], // id of main panel DIV, content DIV, and tab DIV stateconfig: {initial: "0px", persiststate: true}, // initial: initial reveal amount in pixels (ie: 5px) animate: {enabled: true, steps: 5}, //steps: number of animation steps. Int between 1-20. Smaller=faster. pointerimage: {enabled: true, src: ["arrow-down.gif", "arrow-up.gif"]}, closepanelonclick: {enabled: true} // close panel when links or elements with CSS class="closepanel" within container is clicked on? }) Hi everyone, So basically what I am trying to do here is make a navigation system for a website. I want to have a series of buttons that drop down a large panel with info and furhter links when you mouseover them, kind of like the Unilever site: http://unilever.com/ (mouseover the arrows to the side of "About us", Our Brands", etc). So I followed WebDesignerWall's Simple slide panel tutorial (http://www.webdesignerwall.com/tutor...for-designers/, which is basically exactly what I am after - except that I want to have the slide out/slide back happen on a mouseover/mouseout. The code I used looks like so: Code: $(document).ready(function(){ $(".btn-slide").mouseover(function(){ $("#panel").slideToggle("slow"); $(this).toggleClass("active"); return false; }); $("#panel").mouseout(function(){ $("#panel").slideToggle("slow"); $(".btn-slide").toggleClass("active"); return false; }); }); It kind of works but is pretty easily broken in a way that you couldn't just put up with. The slider sometimes repeatedly slides in and out, apparently all by itself, and the panel is sometimes stuck open when the mouse is nowhere near it - and therefore technically should be be hidden. I also tried the same thing using hover rather than mouseover, but unfortunately that breaks it even worse, since I want the panel to stay open when the user's mouse is within the panel area, not just within the button. So I'm wondering if anyone can offer me any suggestions as to how to get this to work, or even just an alternative way to achieve a simliar effect? I do like the sliding animation but I'm willing to forgo that for reliable functionality. Thanks in advance for any help! Hi, I was wondering if anyone knew how I can close an accordian panel by clicking on it. In more detail, when the user clicks the panel title, it opens it, i want it to close if they click the title again. Im using Adobe's Spry framework. Any help would be great. -M Hello, I am trying to get this sliding panel to automatically be open when the page loads. Right now it is closed and I need to click it to open. I would like for it to be automatically opened when the page first loads and click to close it. Can anyone help me with the coding? Here is the code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Demo</title> <style type="text/css"> @import url(style.css); </style> <script src="jquery.js" type="text/javascript"></script> <script src="javascript.js" type="text/javascript"></script> </head><body> <center> <div class="contenta"><img src="4.jpg" /></div> <div id="header"> <img src="2.jpg" width="938" height="68" border="0" /> </div> <div id="page_container"> <div id="toppanel"> <div style="height: 0px; display: block;" id="panel"><img src="1.jpg" width="938" height="583" /></div> <div class="panel_button" style="display: block;"><a href="#">Expand</a></div> <div class="panel_button" id="hide_button" style="display: none;"><a href="#">Close</a></div> </div> <div id="content"><img src="5.jpg" /></div> </div> </center> </body></html> and javascript.js $(document).ready(function() { $("div.panel_button").click(function(){ $("div#panel").animate({ height: "400px" }) .animate({ height: "300px" }, "fast"); $("div.panel_button").toggle(); }); $("div#hide_button").click(function(){ $("div#panel").animate({ height: "0px" }, "fast"); }); }); and css: body { text-align: center; margin: 0px; background: #000; } #page_container { position: relative; margin-left: 0px; margin-right: 0px; width: 938px; } #header { margin-left: 0px; margin-right: 0px; width: 938px; background: #111; } .panel_button { margin-left: 0px; margin-right: 0px; position: relative; top: -25px; padding-top: 5px; width: 100px; height: 22px; background: url(images/panel_button.png); z-index: 20; filter:alpha(opacity=70); -moz-opacity:0.70; -khtml-opacity: 0.70; opacity: 0.70; cursor: pointer; } .panel_button img { position: relative; top: 10px; } .panel_button a { text-decoration: none; color: #FFF; font-size: 12px; font-weight: bold; position: relative; font-family: Arial, Helvetica, sans-serif; } .panel_button a:hover { color: #999999; } #wrapper { margin-left: 0px; margin-right: 0px; width: 100%; text-align: center; } #toppanel { width: 100%; left: 0px; top: 0px; z-index: 25; text-align: center; } #panel { width: 938px; position: relative; top: 1px; height: 0px; margin-left: 0px; margin-right: 0px; z-index: 10; overflow: hidden; text-align: left; } #panel_contents { background: black; filter:alpha(opacity=70); -moz-opacity:0.70; -khtml-opacity: 0.70; opacity: 0.70; height: 100%; width: 938px; position: relative; z-index: -1; } #content { margin-left: 0px; margin-right: 0px; width: 100%; position: relative; text-align: left; color: #545454; font-family: Arial, Helvetica, sans-serif; font-size: 12px; } div.contenta { width: 938px; margin-left: 0px; margin-right: 0px; } Thank you. I don't know Jquery/Javascript too well at all but I can look at this code and see its pretty simple.. jQuery Panel: Code: $(document).ready(function() { // Expand Panel $(".open").click(function(){ $("div#panel").slideDown("slow"); }); // Collapse Panel $(".close").click(function(){ $("div#panel").slideUp("slow"); }); // Switch buttons from "Log In | Register" to "Close Panel" on click $("#toggle a").click(function () { $("#toggle a").toggle(); }); }); and to trigger it from any link on the page it would need somethin like Code: $(".contact").click(function(){contactPanel()}); but I dont know how to give Panel code the name "contactPanel".. so this is where I'm stuck. how do i do this? also I have a "Open Contact Form" at the top of the page but I want to put a contact link at the very bottom and after the link is clicked i would like for the website to scroll up before the panel drops down.. is that possible? Hi, I'm not sure where I have translated this incorrectly. I have one google map embedded on my page which works fine. But I wanted to add a second one. I thought the easiest way to do this would be to have a second page which is called later on with all the details on it for the second map. However although I think (this I presume is where I went wrong) I have replicated the instructions correctly the place holder for the second map just remains blank. This is the code for my called page with the instructions for the second map: PHP Code: <?php echo $_POST['Map'] . '<br />'; ?> <div id="placemap_canvas"></div> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html {height:250px} body {height:250px} #placemap_canvas {width:100%; height:150px;} </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true" /> </script> <script type="text/javascript"> var latlng = new google.maps.LatLng ( <?php include("dbconnect.php"); $result = mysql_query("SELECT * FROM regions WHERE RegionPId='{$_POST['Map']}'"); while($row = mysql_fetch_array($result)){ echo $row['maplink']; } mysql_close($con); ?> ); var myOptions = { zoom: 4, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("placemap_canvas"), myOptions); } </script> And this is the script of the main page, just in case I would be better off keeping them both in one place. Code: <head> <script type="text/javascript"> function loadSubPlace(File,ID,Msg,Eile,EID,Esg){ loadXMLDoc1(File,ID,Msg); var mimer = setTimeout(function(){loadXMLDoc1(Eile,EID,Esg)},5000); } </script> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html {height:250px} body {height:250px} #map_canvas {width:30%; height:250px;} </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true" /> </script> <script type="text/javascript"> function initialize() { var latlng = new google.maps.LatLng ( <?php include("dbconnect.php"); $result = mysql_query("SELECT * FROM countries WHERE Country='{$_SESSION['Country']}'"); while($row = mysql_fetch_array($result)){ echo $row['Map']; } mysql_close($con); ?>); var myOptions = { zoom: 4, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); } </script> </head> <body onload="initialize()"> <div class="countryright" id="map_canvas"> include("dbconnect.php"); $snowball=explode(';',$_POST['syringa']); $turnsol=$snowball[1]; $violet =$snowball[2]; $wakerobin=$snowball[3]; global $turnsol; global $violet; global $wakerobin; echo '<center><b><big>' . $wakerobin. '</big></b></center><br /><br />'; $result=mysql_query("SELECT * FROM regions WHERE country='{$turnsol}' AND region='{$violet}' AND place='{$wakerobin}' AND sub !='' ORDER BY sub ASC"); while($row = mysql_fetch_array($result)){ $wheat="{$row['RegionPId']};{$turnsol};{$violet};{$wakerobin};{$row['sub']}"; $tigerlilly=$row['RegionPId']; echo '<input type="button" class="button3" name="place" id="place" value="' . $row['sub'] . '" onclick="loadSubPlace(\'getPlace.php\',\'txtHintPlaceSub\',\'hepatica=' . urlencode($wheat) . '\',\'getPlaceMap.php\',\'placemapcanvas\',\'Map=' . urlencode($tigerlilly) . '\');" />'; } echo '<input type="button" class="button3" name="addplace" id="addplace" value="Add Place" onclick="loadXMLDoc1(\'getAddPlaceSub.php\',\'txtHintPlaceSub\', encodeURI(\'addsubplace=' . $_POST['syringa'] . '\'));" />'; echo '<br /><br /><div id="txtHintPlaceSub"></div><br /><br />'; mysql_close($con); ?> I've cut out the script that doesn't relate to this so I hope I haven't missed anything important. Hi friends, Am customizing a Joomla website and i need to know how to get a nice and fine javascript accordion horizontal panel which is so smooth and good looking to add in Joomla Home page. Please suggest me some horizontal javascript accordion with images and link to another page. Thanks in Advance. Hi, I am using a wordpress jquery based plugin. TheThe Sliding panels. You can see the jquery he - http://www.get-me-heard.com/wp-conte...jquery.ttsp.js The panel currently auto-opens when the page loads. Which is what I want, however I would like it so that once a user has clicked to close the panel, for it to stay closed even when navigating pages, until they decide to click open again. I would also need the cookie flushed when they leave the website so that the next time they return the panels auto open again. Essentially I just dont want the users to have to click close every time they navigate throughout the website if they don't want to see the panels. NOTE: The plugin has several panels which you can choose from. I am only using the left panel and the right panel. They are all controlled within the jquery. Thanks! |