On click container, get his children a href go to this page url
1 2 3 4 |
$( ".portfolio .mod-banner__img" ).click(function() { //alert($(this).find("a").attr("href")); window.location = $(this).find("a").attr("href"); }); |
1 2 3 4 |
$( ".portfolio .mod-banner__img" ).click(function() { //alert($(this).find("a").attr("href")); window.location = $(this).find("a").attr("href"); }); |
1 2 3 |
if (window.location.href.indexOf("your-string") > -1) { alert("Action"); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
jQuery(document).ready(function($) { if (window.location.href.indexOf("?elementId=3") > -1) { //alert("found it"); var myMemberString = $( "div.search-object-detail-bloc ul li:nth-child(2)" ).html(); var arr = myMemberString.split(' '); // URL arr[0] var memberUrl = arr[0]; var memberName = myMemberString.split('.jpg').pop().split('-')[0]; // returns 'Prénom - Nom' //var memberPoste = myMemberString.split('-')[1]; var memberEmail = myMemberString .match(/([a-zA-Z0-9._+-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi);; $( "div.search-object-detail-bloc ul" ).append("<li><img src='" + memberUrl + "' /></li>"); $( "div.search-object-detail-bloc ul" ).append("<li><strong>" + memberName + "</strong></li>"); // $( "div.search-object-detail-bloc ul" ).append("<li>" + memberPoste + "</li>"); $( "div.search-object-detail-bloc ul" ).append("<li>" + memberEmail + "</li>"); } }); |
1 2 3 4 |
var content1 = $( ".classcontent1" ).html(); var content2 = $( ".classcontent2" ).html(); $('.classcontent1').html(content2); $('.classcontent2').html(content1); |
1 2 3 4 5 |
<script type="text/javascript"> if(jQuery( document ).width() <= "1140"){ jQuery(".menu-phone a").attr("href", "tel:1-844-565-6464"); } </script> |
1 2 3 4 5 6 7 |
jQuery('.section-container .img-logo').each(function() { if (jQuery(this).isOnScreen()) { jQuery(this).addClass('is-on-screen'); } else { jQuery(this).removeClass('is-on-screen'); } }); |
1 2 3 |
<script language="JavaScript"> document.location.href="http://www.domain.com" </script> |
1 2 3 4 5 6 |
jQuery(document).ready(function ($) { $(".button_link").click(function () { $('#iframe_container').show(); $("#iframe_container").attr("src", "https://www.google.com/"); }); }); |
1 |
<iframe id="iframe_container" src=""></iframe> |
1 2 3 4 5 6 7 8 9 10 11 |
// Caroussel img $(".caroussel_link") .mouseover(function() { //alert("test"); var src = $(this).find("img").attr("src").replace(".jpg", "_hover.jpg"); $(this).find("img").attr("src", src); }) .mouseout(function() { var src = $(this).find(".caroussel_img img").attr("src").replace("_hover.jpg", ".jpg"); $(this).find(".caroussel_img img").attr("src", src); }); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$('a[href*="#"]:not([href="#"])').click(function() { var target = $(this.hash); $('html,body').stop().animate({ scrollTop: target.offset().top - 100 }, 'linear'); }); if (location.hash){ var id = $(location.hash); } $(window).load(function() { if (location.hash){ $('html,body').animate({scrollTop: id.offset().top -100}, 'linear') }; }); |