tekgrl
asked on
How to write a proper ELSE statement
Hi all. I have currently am using this javascript:
<script language="javascript">
$(document).ready(function (){
$("a[rel^='prettyPhoto']") .prettyPho to({
theme:'pp_default',
showTitle: true
});
});
</script>
What I want to add is that IF rel=prettyPhoto2 THEN theme:'new_theme'
Not sure how to properly do this.
<script language="javascript">
$(document).ready(function
$("a[rel^='prettyPhoto']")
theme:'pp_default',
showTitle: true
});
});
</script>
What I want to add is that IF rel=prettyPhoto2 THEN theme:'new_theme'
Not sure how to properly do this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops, sorry, small glitch. Use this instead:
$.each($("a[rel^=prettyPhoto]"),
function(itemIndex, item) {
item.prettyPhoto({
theme: (item.rel=='prettyPhoto2')? 'new_theme' : 'pp_default',
showTitle: true
});
}
);
ASKER
Beautiful! Thanks.
Open in new window