Hi All,
I am creating an google map page with some address markers in wordpress. I have added infobox for addres with some images to be shown in each infobox. Each marker's infobox can have its own image set i.e marker1 can show image1, image2 in infobox and marker2 can show image3, image4 and image5.
here image[1-5] are just reference of an actual image. Now I wanted to have the cycle plugin effect for each infobox but the cycle plugin is not working for infobox. On outside infobox(and map) the cycle plugin works well but not inside infobox. Probably I am missing some configuration or doing incorrectly, so I need some assistance.
Some code reference I am adding below PHP+html
- ...
- if( $record){foreach( $record as $row){
- if (($isanyimagetoshow==1 )|| (strlen($row->livevideo)>0)){
- $myHTML=$myHTML."<div class=\"col-md-8\" style=\"padding:0%\">";
- $myHTML=$myHTML."<div class=\"mycycle$i\" style=\"padding:0%\">";
-
-
-
- //Loop for all images
- if (strlen($imagelink1)>0){
-
- $myHTML= $myHTML. "<a href=\"".$imagelink1."\" rel=\"gallery".$i."\" onclick='jQuery(this).colorbox({rel:\"gallery".$i."\",href:\"".$imagelink1."\"});return false'><img class=\"\" style=\"width:100px;height:100px;vertical-align:middle; float:left;\" src=\"".$imagelink1."\"></a>";
- }
-
- if (strlen($imagelink2)>0){
- $myHTML= $myHTML. "<a href=\"".$imagelink2."\" rel=\"gallery".$i."\" onclick='jQuery(this).colorbox({rel:\"gallery".$i."\",href:\"".$imagelink2."\"});return false'><img class=\"\" style=\"width:100px;height:100px;vertical-align:middle; float:left;\" src=\"".$imagelink2."\"></a>";
- }
- .....
- if (strlen($imagelink5)>0){
- $myHTML= $myHTML. "<a href=\"".$imagelink5."\" rel=\"gallery".$i."\" onclick='jQuery(this).colorbox({rel:\"gallery".$i."\",href:\"".$imagelink5."\"});return false'><img class=\"\" style=\"width:100px;height:100px;vertical-align:middle; float:left;\" src=\"".$imagelink5."\"></a>";
- }
- $myHTML= $myHTML. "</div>";
- $myHTML= $myHTML. "</div>";
- ....
- $arr[$i][0]=$myHTML;
- ....
- ...
- <script type="text/javascript">
- <?php print "arr = ".json_encode($arr).";\n"; ?>
- </script>
- ....
- echo "<script type=\"text/javascript\">";
- echo "jQuery(document).ready(function() {";
- echo "jQuery(\".mycycle$i\").cycle({";
- echo "fx: 'fade' ";
- echo "});";
- echo "});";
- echo "</script>";
- .....
- ...
- myinfowindow[id]=new InfoBubble({
- map: map,
- position: new google.maps.LatLng(-35, 151),
- shadowStyle: 1,
- padding: 10,
- backgroundColor: 'rgb(255,255,255)',
- borderRadius: 4,
- arrowSize: 10,
- borderWidth: 0,
- borderColor: '#2c2c2c',
- disableAutoPan: false,
- hideCloseButton: false,
- arrowPosition: 30,
- disableAnimation:false,
- arrowStyle: 0,
- maxWidth:400,
- });
- myinfowindow[id].setContent(arr[i][0]);
- ...
- ....
The below code is for cycle initiation
- echo "<script type=\"text/javascript\">";
- echo "jQuery(document).ready(function() {";
- echo "jQuery(\".mycycle$i\").cycle({";
- echo "fx: 'fade' ";
- echo "});";
- echo "});";
- echo "</script>";
I am getting message "
[cycle] terminating; zero elements found by selector"
I tried changing the
jQuery('.mycycle$i') to myWind$i.
mycycle$i but that did not worked too.