javascript - Want to copy url from container and then use it as bg but I can't -
so have code
$(function () { if (window.location.pathname.indexof('/u') == 0) { var imgdefondo = $('#field_id2 dd.ajax-profil_parent div.field_uneditable').text(); //*****imagen de fondo*****// $("td.row1 div#profile-advanced-details.genmed").css("background", "url('imgdefondo') no-repeat center"); } }); it's supposed copy text in container named "imagen de portada:" should image , use background image of "td.row1 div#profile-advanced-details.genmed", doesn't work code, tried couple of javascript checkers , said variable "imgdefondo" unused, how modify code make work want to?
hope can me
webpage: http://evolvelatam.foroweb.org/u1
it not work because imgdefondo not variable, part of string. need concatenation.
$("td.row1 div#profile-advanced-details.genmed").css("background", "url('" + imgdefondo + "') no-repeat center");
Comments
Post a Comment