[Solved] change the css via php [closed]

To sum up the discussions regarding your question: There (could be) no need to do this serverside. You can read the values of those options via Javascript and change the styles accordingly. You only need php, if you want to remember those settings for the user in a database or something like that. It is … Read more

[Solved] Calculator jquery [closed]

You should do html = parseInt(this.prevEq) + parseInt(html); and html = parseInt(this.prevEq) – parseInt(html); Instead of html = parseInt(html) + parseInt(this.prevEq); and html = parseInt(html) – parseInt(this.prevEq); The order is not a problem when you’re adding. It is when you’re subtracting. (a + b) == (b + a) but (a – b) != (b – … Read more

[Solved] Ajax post is not working

var declares the variable within its function scope only. So make sure your AJAX call is within that function (or remove the var – which declares the variable in global scope). mysubject sounds like submitting form data. Try $(‘form#myformid’).serialize() instead of the data property if you want to submit form data over your AJAX call. … Read more

[Solved] How to remove issues in jQuery [closed]

Probably he suggested that you are only using global variables, and no functions with parameters. That can be a choice, but I’d say it doesn’t matter in smaller web applications. Hardcoded static data can be irritating when you want to change it. If you decide that the color must me more bluish than it is … Read more

[Solved] json parse with jQuery loop [closed]

It should be $.each(data.results[0].address_components, function(i,inside) instead of $.each(data.results.address_components, function(i,inside) because you are taking data from the first results set. Here is a demo Note: I don’t know if there can be multiple results. If it can, then you must first iterate over the results and then inside it on address_components. 1 solved json parse with … Read more

[Solved] Create textbox dynamically in td next to specified td in html table using jquery

Try something like this, it will remove 1st textbox when you click on 2nd option. Jquery code <script> $(document).ready(function(){ $(“.radio_action”).click(function(){ if($(this).val() == “E” ){ $(“#other_text”).html(“”); $(“#emp_text”).html(“<input type=”text” >”); } else if($(this).val() == “A” ) { $(“#emp_text”).html(“”); $(“#other_text”).html(“<input type=”text” >”); } }) }); </script> HTML code <table> <tr> <td><input type=”radio” name=”radio_type” value=”E” class=”radio_action” /> Employee</td> <td … Read more

[Solved] How to animate a div move horizontally when page is scroll down? [closed]

Since you included the jQuery tag, I’ll give you a jQuery-based solution. First, let’s set up some structure for the example: HTML <div class=”sample red”></div> <div class=”sample green”></div> <div class=”sample blue”></div> <br> <div class=”new”>aaa</div> The three “sample” divs are the ones that’ll animate as we scroll. “new” is the content. CSS .sample { width:100px; height:300px; … Read more

[Solved] Jquery add li class active

try this JQUERY first give the id to your ul <ul class=”nav nav-tabs” id=”nav_tabs”> then use jquery $(document).ready(function(){ $(‘ul#nav_tabs li a’).each(function(index, element) { var li = $(element).attr(‘href’); $(element).parent().removeClass(“active”); var filename = window.location.href.substr(window.location.href.lastIndexOf(“https://stackoverflow.com/”)+1); if(filename==li) { $(element).parent().addClass(“active”); } }); }); also you can use PHP as <?php $my_url = $_SERVER[‘REQUEST_URI’]; $page = substr($my_url, strrpos($my_url, “https://stackoverflow.com/”) + 1) … Read more

[Solved] How to Refresh a DIV every X Seconds [closed]

If your advert isn’t random, and it’s just refreshing the div contents (maybe due to the content being a video), then you can use jQuery in this way: $(document).ready(function() { function refresh() { var div = $(‘#target-div’), divHtml = div.html(); div.html(divHtml); } setInterval(function() { refresh() }, 300000); //300000 is 5minutes in ms }) this will … Read more

[Solved] “Cannot read property … of undefined” in jQuery 1.11.0 — how can I satisfy jQuery’s requirement?

You have incorrect syntxis What do you whant to do with ? jQuery(function() { jQuery.each(jQuery(‘h1’).add(‘h2’).add(‘h3’).add(‘h4’).add(‘h5’).add(‘h6’).add(‘ul#navigation’)).function(index, element) { var bounds = jQuery(element).offset(); var image_left = bounds.left; var image_top = bounds.top + bounds.height; var image = jQuery(‘<img src=”https://stackoverflow.com/media/images/foldback.png”>’); image.style.position = ‘absolute’; image.style.top = image_top + ‘px’; image.style.left = image_left + ‘px’; } function set_search_width() { var offset … Read more

[Solved] How to slide images in div up and down with jquery?

You could animate the scrollTop property of the .content element var gallery = $(‘.content’), height = gallery.height(); $(‘.arrow’).on(‘click’, function(){ var up = $(this).is(‘.up_arrow’); if (up) { gallery.animate({‘scrollTop’: ‘-=’ + height}); } else { gallery.animate({‘scrollTop’: ‘+=’ + height}); } }); Demo at http://jsfiddle.net/gaby/a2xmr1mn/ note: i have added a common (arrow) class to the arrows for styling/targeting … Read more