15

Tip: Hide tabs with javascript for more accurate preview

http://drupal.org

Sometimes I get annoyed by having to log out to see what the page looks like without the editing-tabs (like when doing pixel-precise positioning). I just wanted to share this bit of code for adding a link for removing the tabs with a click while developing your theme. I'm working with Zen sub-theme and it requires jquery javascript library to be included.

Just add this
<a href="#" onclick="$('div.tabs').hide()" style="float:right; margin-top:-15px;"><?php print t('Hide'); ?></a>

in page.tpl.php like so:
<?php if ($tabs): ?>
              <div class="tabs"><?php print $tabs; ?><a href="#" onclick="$('div.tabs').hide()" style="float:right; margin-top:-15px;"><?php print t('Hide'); ?></a></div>
<?php endif; ?>

Enjoy!

Read »
Created by Dplanet 2 years 33 weeks ago – Made popular 2 years 33 weeks ago
Category: Theming   Tags:

PSD to Drupal Theme

Drupal Development

Module Development

Get an Estimate

Tags for Tip: Hide tabs with javascript for more accurate preview

Recent comments