I am trying to add a background image to that div that is within the content of Google Map Infobox. I'm running into problems because the function I used to replace .css ('background-image') is not in identifying the ID of the div. This is likely to happen because the string of content is not loaded, when Infobox is opened. I know that I have to listen to an event 'domed' or similar, but I am not sure how to implement it. The code in question is given:
var boxcontent = var boxcompany = " gt; img id = Logo src = "+ + Logopath +" /> gt; & lt; h1 & gt; "+ number +" & lt; br / & gt; + Road + "
" + City + "& lt; / h1 & gt; & lt; h2 & gt; & Lt; / Div & gt; & Lt; Div id = menu & gt; & Lt; Br / & gt; & Lt; + "Button ID = Photo onClick = buttonState (this.id)> & Lt; Img src = infomenu / commentsicon.png & gt; & Lt; / Button & gt; + "Button ID = Games onClick = buttonState (this.id)> gt; & lt; / div & gt; Var myOptions = {content: boxContent, disableAutoPan: false, pixel offset: new google.maps.size (-400, -173), close box margin: "-12px-12px 0px 0px", closeBoxURL: "close.png", Info Box Clearance: New Google.maps.Size (1, 1), Panel: "FloatPain", Enable EventPropagation: false}; Var ib = New InfoBox (My Option); Google.maps.event.addListener (Marker, 'click', function (e) {map.setZoom (13); map.setCenter (this.getPosition ()); ib.open (map, this, display phone (image path); }} Function display (imagepath) {$ ('# display'). Css ('background-image', 'url (' + imagepath + '1.png)');} < / Div>
InfoBox.open takes only 2 parameters - a map and an anchor. I have got property separately. I think that by holding the context of the boxContent DOM element you will have a life Box content [0], disabledOptain: incorrect, pixoff offset: new google.maps.size (-400, -173), close box margin: "-12px-12px 0px 0px", closeBoxURL: "http: //www.carltonhotelblanchardstown .com / files / images / a / calendar-popup-close.png ", info box clearance: new google.maps.size (1, 1), pane:" floatpan ", enabled eventPropagation: false};
No comments:
Post a Comment