Code Pad
Code
List Code
Search Code
Images
List Images
Search Images
Login
Privacy
Home
deep tab linking via # for foundation 6 tabs
jquery ui datepicker
js
styling css elements based on their attributes
css
animate background gradient css
css
linear gradient background with 3 colours
css
web storage testing
js
load a script based on a page condition variable
jquery
loop through elements and change the content using each and substr with jquery
jquery
mega menu testing
css
basic foundation grid layout
html
deep tab linking via # for foundation 6 tabs
1:36 am, November 28, 2018
via here: https://haensel.pro/javascript/foundation-6-tabs-by-url-anchor-link
Code
html
css
js
scripts
html
css
js
/* Deep linking for Foundation 6 Tabs using Javascript */ $(document).ready(function(){ if(window.location.hash) { // We have an anchor link in our URL var f6dl_url = window.location.hash; var f6dl_hash = f6dl_url.substring(f6dl_url.indexOf("#")+1); if($('#'+f6dl_hash).length) { // Insert id of the
that holds the links to the tabs var f6dl_ulid = 'example-tabs'; $('#' + f6dl_ulid).find('a').each(function(e) { var f6dl_href = $(this).attr('href'); if(f6dl_href == "#"+f6dl_hash) { // Click the link to activate the tab $(this).click(); } }); } } });
scripts
Download & Run
Download File
Run Demo
Re-load Preview
Preview
VU1KW