-
AuthorPosts
-
akerman Friend
akerman
- Join date:
- August 2010
- Posts:
- 31
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 3 times in 1 posts
January 2, 2011 at 9:15 am #158183Hi,
there’s a Javascript controlling the “Show/Hide Description” button on Job listings.
I just want to switch the default behaviour so that it “starts” as “Show Descriptions” and thereby hide descriptions, instead of as now; showing them automatically.
Javascript in Joblisting template:
<script type="text/javascript">
function hideDescription(){
$$('.ja-job-description').setStyle('display', 'none');
$E('#ja-control-description .hide').setStyle('display', 'none');
$E('#ja-control-description .show').setStyle('display', '');
}
function showDescription(obj){
$$('.ja-job-description').setStyle('display', 'block');
$E('#ja-control-description .hide').setStyle('display', '');
$E('#ja-control-description .show').setStyle('display', 'none');
}
</script>
..and the presentation part in same template:
<?php } if( $jbconfig['posts']->get('posts_show_description', 1) ){ ?>
<div id="ja-control-description">
<a class="button hide" href="javascript:hideDescription()">
<span style="vertical-align: top ! important;"><?php echo JText::_('Hide Job Descriptions')?></span>
</a>
<a class="button show" href="javascript:showDescription()" style="display: none">
<span style="vertical-align: top ! important;"><?php echo JText::_('Show Job Descriptions')?></span>
</a>
</div>
Any ideas are welcome
Regards
AkermanVinh CV FriendVinh CV
- Join date:
- August 2009
- Posts:
- 574
- Downloads:
- 0
- Uploads:
- 2
- Thanked:
- 76 times in 72 posts
January 3, 2011 at 7:40 am #369781Dear akerman,
You can simply implement this function:
window.addEvent(‘domready’, function() {
hideDescription();
});akerman Friendakerman
- Join date:
- August 2010
- Posts:
- 31
- Downloads:
- 0
- Uploads:
- 0
- Thanked:
- 3 times in 1 posts
January 3, 2011 at 3:49 pm #369853SOLVED! Thank you so much! :laugh:
Including complete solution here. File = theme files like “../summary/jalist-item.php”:
<script type="text/javascript">function hideDescription(){
$$('.ja-job-description').setStyle('display', 'none');
$E('#ja-control-description .hide').setStyle('display', 'none');
$E('#ja-control-description .show').setStyle('display', '');
}
function showDescription(obj){
$$('.ja-job-description').setStyle('display', 'block');
$E('#ja-control-description .hide').setStyle('display', '');
$E('#ja-control-description .show').setStyle('display', 'none');
}
window.addEvent('domready', function() {
hideDescription();
});</script>
Although, there is a drawback/oddity: As soon as I select some sorting action in the box to the right,
the Description shows anyway… i.e. the javascript alters state. There must be a way of making these to choices (showing vs. sorting) independent from each other.Regards
Akerman -
AuthorPosts
This topic contains 3 replies, has 2 voices, and was last updated by akerman 13 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum