CSS styles change on hover state with JQuery if else statement
$(document).ready(function() {
$('body').mouseover(function() {
if ($('.comsec1').is(':hover')) {
$('.comsec2').css('width','40%');
$('.comsec1').css('width','60%');
}
else if ($('.comsec2').is(':hover')) {
$('.comsec2').css('width','60%');
$('.comsec1').css('width','40%');
}
else {
$('.comsec2').css('width','50%');
$('.comsec1').css('width','50%');
}
});
});
JQuery select the clicked class
Here is a JQuery code snippet to get the clicked div elements's attribute or the value with the similar class names on click function
<script>
$(document).ready(function(){
$('.simg').click(function(){
//var pth = $('.simg').attr('src');
var pth = $(this).attr('src');
console.log(pth);
});
});
</script>
<script>
$(document).ready(function(){
$('.simg').click(function(){
//var pth = $('.simg').attr('src');
var pth = $(this).attr('src');
console.log(pth);
});
});
</script>
JQuery Detect the browser window top and change CSS on page
JQuery Detect the browser window top and change CSS on page
var t = $("#nav2").offset().top;
$(document).scroll(function() {
if ($(this).scrollTop() > t)
{
$('#nav2').css('position', 'fixed');
$('#nav2').css('top', '0');
}
else
{
$('#nav2').css('position', 'relative');
}
});
var t = $("#nav2").offset().top;
$(document).scroll(function() {
if ($(this).scrollTop() > t)
{
$('#nav2').css('position', 'fixed');
$('#nav2').css('top', '0');
}
else
{
$('#nav2').css('position', 'relative');
}
});
Apache localhost to access on LAN computers
Allow your Apache local host to access in LAN computers for Apache 2.4.x
Find <Directory "c:/wamp/www"> </Directory> in your Apache httpd.conf file and Replace with this code
<Directory "c:/wamp/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
# This looks after 127.0.0.1 ::1 and localhost
Require local
# This should be the first 3 quartiles of the standard subnet ipaddress range
Require ip 192.168.0
</Directory>
Find <Directory "c:/wamp/www"> </Directory> in your Apache httpd.conf file and Replace with this code
<Directory "c:/wamp/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
# This looks after 127.0.0.1 ::1 and localhost
Require local
# This should be the first 3 quartiles of the standard subnet ipaddress range
Require ip 192.168.0
</Directory>
Subscribe to:
Posts (Atom)