JQuery Cousins Method
How do I make an jquery cousins method?
Selects the children (with the same element type) of the element's parent's siblings.. What is a jquery cousins method? How do you make a jquery cousins method? This script and codes were developed by James Podles on 01 February 2023, Wednesday.
JQuery Cousins Method - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>jQuery Cousins Method</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <ul> <li><a>one</a></li> <li><a>two</a></li> <li><a>three</a></li>
</ul> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
JQuery Cousins Method - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Open+Sans:300);
* { box-sizing: border-box;
}
ul { font-family: 'Open Sans',sans-serif; font-weight: 300; width: 100%; top: 0; left: 0; right: 0; bottom: 0; position: absolute; margin: auto; height: 5em;
}
ul li:first-child a { background-color: #33404D;
}
ul li:nth-child(2) a { background-color: #688F7D;
}
ul li:nth-child(3) a { background-color: #2C223B;
}
li { width: 25%; font-size: 3em; float: left; margin: .5em;
}
a { color: #fafafa; width: 100%; border-radius: 5px; display: inline-block; padding: 5px 10px 10px 10px; text-align: center; -webkit-transition: -webkit-transform .5s ease-in-out; transition: -webkit-transform .5s ease-in-out; transition: transform .5s ease-in-out; transition: transform .5s ease-in-out, -webkit-transform .5s ease-in-out;
}
a:hover { cursor: pointer;
}
.active { -webkit-transform: scale(1.2); transform: scale(1.2);
}
JQuery Cousins Method - Script Codes JS Codes
$.fn.cousins = function(){ var element = this.prop('tagName'); var $cousins = this.parent().siblings().children(element); return $cousins;
}
$('a').hover(function(){ $(this).addClass('active').cousins().removeClass('active');
});
Developer | James Podles |
Username | jpod |
Uploaded | February 01, 2023 |
Rating | 3 |
Size | 2,682 Kb |
Views | 4,048 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Flyer-flip | 3,641 Kb |
Reading Progress Bar | 4,260 Kb |
Photo Grid | 2,351 Kb |
PracticeIO Circle Fan Menu | 2,272 Kb |
SoundCloud CoverFlow | 3,430 Kb |
PracticeIO Click Counter | 4,019 Kb |
Stack of Cards | 2,633 Kb |
Soft Progress bar | 3,431 Kb |
CSS Bot Confusion | 3,456 Kb |
Scrambled City | 6,489 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Toggle menu | Seyedi | 2,279 Kb |
Price table | Serluk | 5,928 Kb |
Bootstrap 3 Price Table | Honglio | 2,655 Kb |
Coburg Banks SVG Logo | Mjtweaver | 3,875 Kb |
Blog | Rottingroom | 1,430 Kb |
Spinners using Font Icons | Keyamoon | 3,007 Kb |
My Interests | Anshusaxenaarora | 2,015 Kb |
Toolbar | Onsen | 5,414 Kb |
ASCII triangle image overlay | Mitchdot | 2,200 Kb |
Dice | Fraina | 5,026 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!