From: Anthony Talarico Date: Fri, 18 May 2018 17:10:49 +0000 (-0400) Subject: setting up default tabs X-Git-Tag: v1.0.0^2~1^2~75 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=f54e6b18f3e2620f77e1cde0eb2fbf2a264c037b;p=WP-Themes%2Flaurium.git setting up default tabs --- diff --git a/rooms.php b/rooms.php index beaae4f..8ace70c 100644 --- a/rooms.php +++ b/rooms.php @@ -13,7 +13,6 @@ get_header(); $slug = $post->post_name; $content = apply_filters('the_content', $post->post_content); ?> -
@@ -100,14 +99,26 @@ get_header(); // active: 1, // heightStyle: "content" // }); + let tab = 0; + const slug = ''; + const rooms = jQuery('#rooms-tabs').children('ul').children('li'); + rooms.each(function(index, value){ + let room = jQuery(this).children('a').text().toLowerCase() + room = room.substr(0, room.indexOf(' ')); + if( slug.indexOf(room) !== -1 && room){ + tab = jQuery(this).index(); + } + }) + jQuery( ".room-amenities" ).accordion({ collapsible: true, active: false, heightStyle: "content" }); jQuery( "#rooms-tabs" ).tabs({ - active: 1 + active: tab }); + });