I have a website that features a random on-load slideshow with text displayed in div containers for each slide. I am looking to enhance the functionality by adding links or changing the color of specific words within the text. You can view my current progress on this JSFIDDLE link: http://jsfiddle.net/shadna/Agq7W/
For your convenience, here is the code snippet:
JavaScript:
jQuery(function($){
$('#homebanner').css({backgroundColor: "#000"});
var totalCount = 4;
var num = Math.ceil( Math.random() * totalCount );
var hText = ["WE SPEAK ARCHITECTURE", "WE HAVE HIGH SPIRIT(S)", "STRATEGY: BUILT ON HUMAN-CENTERED", "FOREVER IN BLUE JEANS"];
var hsubText = ["CLIENT: EDA ARCHITECTS", "CLIENT: HIGH WEST DISTILLERY", "CLIENT: ARCHITECTURAL NEXUS", "CLIENT: VAULT DENIM"];
function setBGImage() {
var bgimage = 'http://bwpcommunications.com/TESTING/images/homepage/'+num+'.jpg';
$('#homebanner').css({
backgroundImage:"url("+bgimage+")",
});
$('#htxt').html(hText[num - 1]);
$('#hsubtxt').html(hsubText[num - 1]);
}
setBGImage();
});
HTML::
<div id="homebanner">
<div id="hwrap">
<div id="htxt"></div>
<div id="hsubtxt"></div>
</div>
</div>
I would greatly appreciate any guidance or tips from experienced JavaScript users.