how do i prepend the domain (http://www.example.com) to this background URL in every div class ssli_left_image?
i have been trying jquery for the last 2 days with no success.
how do i prepend the domain (http://www.example.com) to this background URL in every div class ssli_left_image?
i have been trying jquery for the last 2 days with no success.
Try the following:
$(".ssli_left_image").each(function(i) {
this.style.backgroundImage = this.style.backgroundImage.replace('url("','url("http://www.mydomain.com');
});
didn’t work.
as a temp php fix i did this
[php]
$table = str_replace(’<div class=“ssli_left_image” style=“background: url(’,’
to change the style to an img tag, which has worked. ATM i am using this jquery with only limited success. and that was only after reading 3 books…
[code]function addtestClass(){
jQuery(’.special_strain_list_item’).addClass(‘testThing’);
}
$(function() {
$( ".special_strain_list_item" ).draggable();
$( ".special_strain_list_item_drop" ).droppable({
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "Strain Saved to favorites!" )
.delay(1500)
.removeClass( "ui-state-highlight" )
.html( "Drop here To Save" );
}
});
});
</script>
[/code]