Reputation: 743
I'm trying to write a statement to say that if there's anything inside #process-description to show #process-work else hide it.
HTML
<div id="process-work">
<h2 id="process-title">Process Work</h2>
<p id="process-description"></p>
</div>
JS
'zeckoshop' : {
'title' : 'zeckoShop',
'description' : 'An all-in-one ecommerce platform designed to seamlessly integrate with your business operations.',
'link' : 'http://darrenbachan.com/playground/zeckoshop/index.html',
'images': [
'/images/zeckoshop/zeckoshop-1.jpg'
],
'tags': [
'Web Design',
'Web Development'
],
'process-description' : 'An all-in-one ecommerce platform designed to seamlessly integrate with your business operations.',
'process-wireframes': [
'/images/zeckoshop/zeckoshop-1.jpg'
]
}
if('#process-work') {
$('#process-description').html(projectData['process-description']).show();
} else {
$('#process-work').hide();
}
Upvotes: 0
Views: 59
Reputation: 31878
I think you are looking fir this change in the code :
if($('#process-description').length) {
$('#process-description').html(projectData['process-description']).show();
} else {
$('#process-work').hide();
}
Upvotes: 1