"Are you sure" alert box with Jquery for submit or a button on click
Script
<script>
$(':submit[name="topup"][value="Request"]').click(function() {
return window.confirm(this.title || 'Are you sure?');
});
</script>
Jquery Numbers Only Text Box
Jquery Numbers Only Text Box
HTML Code for number only typed text box
<input class="login" type="text" onkeypress="return isNumber(event)" name="reserve" id="reserve" />
JQuery Code
<script>
function isNumber(evt) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
return true;
}
</script>
HTML Code for number only typed text box
<input class="login" type="text" onkeypress="return isNumber(event)" name="reserve" id="reserve" />
JQuery Code
<script>
function isNumber(evt) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
return true;
}
</script>
Jquery move background image horizontally on Scroll
How to Move the background image horizontal with the mouse as you scroll with Jquery and CSS which can also use as a horizontal parallax effect. This is done by adding a css class or an id and changing the background image with the JavaScript.
The code
<script>
$(window).scroll(function() {
var x = $(this).scrollTop();
$('.yourDivClass').css('background-position', parseInt(-x / 0.5) + 'px');
});
</script>
The code
<script>
$(window).scroll(function() {
var x = $(this).scrollTop();
$('.yourDivClass').css('background-position', parseInt(-x / 0.5) + 'px');
});
</script>
How to Protect PHP include files
Add this .htaccess file to your includes of the views folder of your PHP project to Protect include files. This file prevents that your .PHP view files are accessed directly from the outside
CODE
<Files ~ "\.(htaccess|php)$">
order allow,deny
deny from all
</Files>
CODE
<Files ~ "\.(htaccess|php)$">
order allow,deny
deny from all
</Files>
JQuery display none div id or class on click function
JQuery display div id or class none on click function by changing the CSS with java script
$("#spinner").click(function () {
$("#sheet").css("display", "none");
});
$("#spinner").click(function () {
$("#sheet").css("display", "none");
});
Subscribe to:
Posts (Atom)