[Solved] pop up window does not open when code added in java script

[ad_1] As pointed out, the problem was that the event handler was listening for any kind of click event in the window object. Instead I refactored the code and put the respective buttons in variables and added the addEventListener. // contact-form opens upon clicking the “get a quote” Button let quoteButton = document.getElementById(‘quote-button’); quoteButton.addEventListener(‘click’, function() … Read more

[Solved] Get latlng and draw a polyline between that two latlng

[ad_1] /*This is script*/ var x=0; var map; var prepath; var path = null; var current_lat = 28.6667; var current_lng = 77.2167; function initialize() { var myLatLng = new google.maps.LatLng(28.6667, 77.2167); var mapOptions = { zoom: 3, center: myLatLng, mapTypeId: google.maps.MapTypeId.TERRAIN }; map = new google.maps.Map(document.getElementById(‘map-canvas’), mapOptions); //alert(“sdf”) google.maps.event.addListener(map, “click”, function (e) { //delete old … Read more

[Solved] Check a Website is Responsive or not using PHP [closed]

[ad_1] Thanks to @Alexander O’Mara for the suggestion. It’s little trick. Not 100% correct way. But working for all sites. <?php ini_set(‘user_agent’, ‘Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9’); $html = file_get_contents(“http://php.net/”); ini_set(‘user_agent’, ‘Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7’); … Read more

[Solved] how to get the time when exiting a textfield? [closed]

[ad_1] On keyup, store the current time in a hidden input. http://jsfiddle.net/trevordixon/hL8YB/ <input type=”text” name=”name” id=”name_input”> <input type=”hidden” name=”name_time” id=”name_time_input” size=”100″> <script> $(‘#name_input’).keyup(function() { var now = new Date(); $(‘#name_time_input’).val(now.toString()); }); </script> 1 [ad_2] solved how to get the time when exiting a textfield? [closed]

[Solved] How to implement the dislike-like button [closed]

[ad_1] erm… you can’t really do that with html alone, mate. You need a server-side script to handle that. Suggest Php. After that, use a GET or POST method to carry your like or dislike vote to the server-side script. [ad_2] solved How to implement the dislike-like button [closed]

[Solved] Fade out/in sperate divs with button click [closed]

[ad_1] Your question is very vague, but hopefully this example will get you started in the right direction: http://jsfiddle.net/3mJ3z/ Basically, there are 3 menu items, and 3 corresponding content items. When you click the menu item, all the other content items disappears and the corresponding content item fades in. The HTML: <div class=”item-1 content-item”> I … Read more

[Solved] Check If String Exists in Text Field

[ad_1] You could use HTML5 form validation. Simply make the field required and give it a pattern. No JS required (although you might choose a polyfill for old browsers). Try and submit this form without matching the pattern: <form> <input name=”myInput” required=”required” placeholder=”Must contain Mickey” pattern=”.*Mickey.*” title=”It must contain Mickey somewhere.” /> <input type=”submit” /> … Read more

[Solved] elegantly animate a stack of divs

[ad_1] fiddle In order to make this work I did a couple of things:- 1 CSS .child { width: 40px; height: 40px; display: block; //inline block results in jerkiness when inserting items margin:2px; //added margin to compensate for inline-block becoming block. border: 1px solid #AAAAAA; } 2 JS setTimeout(function(){ var newbox = “<div class=”child animated … Read more

[Solved] Get url image with javascript?

[ad_1] You could use getElementById in case you have multipe nested images in different id’s. Then you could use getElementsByTagName to get the image elements and loop those using a for loop and storing the src in an array urls. var elms = document.getElementById(‘content’).getElementsByTagName(‘img’); var urls = []; for (var i = 0; i < … Read more

[Solved] Custom thumbnail grid 3 columns? [closed]

[ad_1] like this? or you want the image fill the div?: <div class=”col-md-4 no-pad”> <img class=”img-responsive” src=”https://placehold.it/1280×640/eee”> </div> <div class=”col-md-4 no-pad”> <img class=”img-responsive” src=”https://placehold.it/1280×640/eee”> </div> <div class=”col-md-4 no-pad”> <img class=”img-responsive” src=”https://placehold.it/1280×640/eee”> </div> .no-pad{ padding-left:0px; padding-right:0px; height:381px; } .no-pad img{ width:100%; height:100%; } 3 [ad_2] solved Custom thumbnail grid 3 columns? [closed]

[Solved] Button to increment a number on screen

[ad_1] You have the right idea, but there were a few issues with your code. Side Note: In programming, it’s pretty much always a good idea to name your variables/functions something meaningful and descriptive. In the code sample below, I changed the name of your function hey to increment since the purpose of that function … Read more