Tagged: x
-
AuthorPosts
-
October 22, 2016 at 1:29 pm #1226673
alex5252ParticipantHello I have a video that explains the issue.
https://www.youtube.com/watch?v=q7vke7Mx2_4&feature=youtu.be
the JS function that is doing this is the second code block in our global cornerstone javascript
October 22, 2016 at 1:31 pm #1226674
alex5252ParticipantThis reply has been marked as private.October 22, 2016 at 11:22 pm #1226953
RadModeratorHi there,
Please check this link
jQuery(document).ready(function($) { //link warning var confirmLeave = function(){ var href = $(this).attr("href"); var confirmMessage = "You are leaving State Bank of Pearl City's website. "; confirmMessage += "Links that may be accessed via Third Party Site are for the convenience of informational purposes only. "; confirmMessage += "Any products and services accessed through "; confirmMessage += href; confirmMessage += " are not provided or guaranteed by State Bank of Pearl City. "; confirmMessage += "The site you are about to visit may have a privacy policy that is different than State Bank of Pearl City's. "; confirmMessage += "Please review their privacy policy. "; confirmMessage += "State Bank of Pearl City does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content."; var redirectConfirm = window.confirm(confirmMessage) if(redirectConfirm === false) { return false; } else if($(this).attr("target") !== "_blank"){ window.location.href = href; } }; $("#resourceArticle i.x-icon-external-link").off(); $("#resourceArticle h4").off(); $("#resourceArticle i.x-icon-external-link").on("click", function(){$(this).parent().parent().parent().parent().parent().next().children(".x-img").trigger("click");}); $("#resourceArticle h4").on("click", function(){$(this).parent().parent().parent().next().children(".x-img").trigger("click");}); $("#menu-item-289 a").click(confirmLeave); $("#menu-item-290 a").click(confirmLeave); $("#resourceArticle a.x-img").click(confirmLeave); $("#calculators .x-column .x-text a").click(confirmLeave); $(".x-social-global a").click(confirmLeave); });to this
jQuery(document).ready(function($) { //link warning $(window).load( function() { var confirmLeave = function( e ){ e.stopPropagation(); e.preventDefault(); var href = $(this).attr("href"); var confirmMessage = "You are leaving State Bank of Pearl City's website. "; confirmMessage += "Links that may be accessed via Third Party Site are for the convenience of informational purposes only. "; confirmMessage += "Any products and services accessed through "; confirmMessage += href; confirmMessage += " are not provided or guaranteed by State Bank of Pearl City. "; confirmMessage += "The site you are about to visit may have a privacy policy that is different than State Bank of Pearl City's. "; confirmMessage += "Please review their privacy policy. "; confirmMessage += "State Bank of Pearl City does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content."; var redirectConfirm = window.confirm(confirmMessage) if(redirectConfirm === false) { return false; } else if($(this).attr("target") !== "_blank"){ window.location.href = href; } }; setTimeout ( function(){ $("#resourceArticle i.x-icon-external-link").off(); $("#resourceArticle h4").off(); $("#resourceArticle i.x-icon-external-link").off().on("click", function(){$(this).parent().parent().parent().parent().parent().next().children(".x-img").trigger("click");}); $("#resourceArticle h4").off().on("click", function(){$(this).parent().parent().parent().next().children(".x-img").trigger("click");}); $("#menu-item-289 a").off().click(confirmLeave); $("#menu-item-290 a").off().click(confirmLeave); $("#resourceArticle a.x-img").off().click(confirmLeave); $("#calculators .x-column .x-text a").off().click(confirmLeave); $(".x-social-global a").off().click(confirmLeave); }, 300 ); } ); });This ensures that your javascript is loaded only after other javascript. Hence, overriding previously binded click and touch events on mobile.
Thanks!
October 23, 2016 at 8:33 am #1227257
alex5252ParticipantThank you for the reply. I did put your new code in, but it is still now working. It is also no longer working on desktop. I’m not sure if I put the code in incorrectly or what, but if you could take a look I would appreciate that.
October 23, 2016 at 5:20 pm #1227582
RadModeratorHi there,
I made some changes, it should work now. At least for two menu links based on your existing code.
Thanks!
October 23, 2016 at 5:41 pm #1227596
alex5252ParticipantThank you. It is woorkkng now, however it is promting me to click “ok” twice. Do you know why that might be?
October 23, 2016 at 11:41 pm #1227876
RadModeratorHi there,
Looks like it’s triggering twice (touch and click).
I changed it to this
jQuery(document).ready(function($) { //link warning $(window).load(function(){ var confirmLeave = function(e){ e.stopPropagation(); e.preventDefault(); var href = $(this).attr("href"); var confirmMessage = "You are leaving State Bank of Pearl City's website. "; confirmMessage += "Links that may be accessed via Third Party Site are for the convenience of informational purposes only. "; confirmMessage += "Any products and services accessed through "; confirmMessage += href; confirmMessage += " are not provided or guaranteed by State Bank of Pearl City. "; confirmMessage += "The site you are about to visit may have a privacy policy that is different than State Bank of Pearl City's. "; confirmMessage += "Please review their privacy policy. "; confirmMessage += "State Bank of Pearl City does not endorse the content contained in these sites, nor the organizations publishing those sites, and hereby disclaims any responsibility for such content."; var redirectConfirm = window.confirm(confirmMessage) if(redirectConfirm === false) { return false; } else if($(this).attr("target") !== "_blank"){ window.location.href = href; } } setTimeout(function(){ $("#resourceArticle i.x-icon-external-link").off(); $("#resourceArticle h4").off(); $("#resourceArticle i.x-icon-external-link").on("click", function(){$(this).parent().parent().parent().parent().parent().next().children(".x-img").trigger("click");}); $("#resourceArticle h4").on("click", function(){$(this).parent().parent().parent().next().children(".x-img").trigger("click");}); $("#menu-item-289 a").on('touchend click', confirmLeave); $("#menu-item-290 a").on('touchend click', confirmLeave); $("#resourceArticle a.x-img").click(confirmLeave); $("#calculators .x-column .x-text a").click(confirmLeave); $(".x-social-global a").click(confirmLeave); }, 300); }); }); jQuery(document).ready(function($) { //email warning var emailWarning = function(){ var warningMessage = "Please do not include any sensitive personal or financial information such as social security numbers or account numbers. "; warningMessage += "If you would like to send us a secure message, please log in to Internet banking and use the secure messaging tools there."; var redirectConfirm = window.confirm(warningMessage) if(redirectConfirm === false) { return false; } else if($(this).attr("target") !== "_blank"){ window.location.href = href; } }; $('a[href^="mailto"]').click(emailWarning); }); jQuery(document).ready(function($){ $("#menu-item-301 > ul").mouseover(function() { $("#menu-item-301 a.ubermenu-target").addClass("iframeHover"); }); }); jQuery(document).ready(function($){ $("#menu-item-301 > ul").mouseout(function() { $("#menu-item-301 a.ubermenu-target").removeClass("iframeHover"); }); }); jQuery(document).ready(function($){ $(".x-colophon.top").after('<footer class="x-colophon middle"><button><a href="tel:8154432725">Call<br>Pearl City</a></button><button><a href="tel:8152448800">Call<br>Mt. Carroll</a></button></footer>'); });Cheers!
October 24, 2016 at 7:04 am #1228248
alex5252ParticipantThank you. That does seem to work now, however now I noticed when I click “Cancel” it doesn’t exit, it still redirect to the new website in the link instead of canceling.
October 24, 2016 at 10:24 am #1228450
RadModeratorHi there,
What browser does it happen? Seems okay from my end. Maybe that browser handles confirm window differently than desktop counterpart. Are we still on navigation’s link pop-up issue?
Thanks!
October 24, 2016 at 10:26 am #1228451
alex5252ParticipantI am on safari on iPhone 7.
Yes, we are still on the nagigation link pop up issue.
October 25, 2016 at 7:59 am #1229756
RadModeratorHi there,
Have you decided to discontinue this pop-up? I checked and the script is disabled (commented) and the navigation links are gone.
But personally, I prefer to put external links on page content than on the navigation. Because placing them on your navigation is also encouraging your user to easily abandon your site. And it’s much better to open them on browser tab/window.
Thanks!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1226673 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
