OSC-Sevilla Posted April 3, 2012 Share Posted April 3, 2012 I have three different ways to view a page. and three diffent buttond to show/hide pages. Now, i want to default via admin the initial show/hide page . lets say i want to default (the first page shown) to a list style: i need some java above this to fire either a.row_view a.list_view a.table_view based on my admin prefernce. see: http://www.verdegia.com/FASAL/business/index.php?cPath=145 $(document).ready(function(){ $('a.row_view').click(function() { $('.contentPadd.r_view').css('display', 'block'); $('.contentPadd.l_view').css('display', 'none') $('.contentPadd.t_view').css('display', 'none'); }); $('a.list_view').click(function() { $('.contentPadd.r_view').css('display', 'none') //horizontal $('.contentPadd.l_view').css('display', 'block') //list $('.contentPadd.t_view').css('display', 'none') //thumbnails }); $('a.table_view').click(function() { $('.contentPadd.r_view').css('display', 'none') $('.contentPadd.l_view').css('display', 'none') $('.contentPadd.t_view').css('display', 'block') }); }); thanks Link to comment Share on other sites More sharing options...
OSC-Sevilla Posted April 3, 2012 Author Share Posted April 3, 2012 i have this but its not working.. need help: <?php if (DISPLAY_PRODUCT_LISTING_LAYOUT_SWITCH == 'true'){ if (DISPLAY_PRODUCT_LISTING_LAYOUT == 'thumbnail'){$r_view = 'none';$l_view = 'none';$t_view = 'block';} if (DISPLAY_PRODUCT_LISTING_LAYOUT == 'horizontal'){$r_view = 'block';$l_view = 'none';$t_view = 'none';} if (DISPLAY_PRODUCT_LISTING_LAYOUT == 'list'){$r_view = 'none';$l_view = 'block';$t_view = 'none';} ?> <script language="javascript"> $(document).ready(function(){ $('.contentPadd.r_view').css('display', '<?php $r_view ?>'); $('.contentPadd.l_view').css('display', '<?php $l_view ?>') $('.contentPadd.t_view').css('display', '<?php $t_view ?>'); }); $(document).ready(function(){ $('a.row_view').click(function() { $('.contentPadd.r_view').css('display', 'block'); $('.contentPadd.l_view').css('display', 'none') $('.contentPadd.t_view').css('display', 'none'); }); $('a.list_view').click(function() { $('.contentPadd.r_view').css('display', 'none') //horizontal $('.contentPadd.l_view').css('display', 'block') //list $('.contentPadd.t_view').css('display', 'none') //thumbnails }); $('a.table_view').click(function() { $('.contentPadd.r_view').css('display', 'none') $('.contentPadd.l_view').css('display', 'none') $('.contentPadd.t_view').css('display', 'block') });}); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.