Đang Thực Hiện

151017 Change bg image via JS

I need to change a background image via JS and CSS (DHTML) when a user clicks on a link. The background-image property is stored in a css id for each of my links. When the clink is clicked, the background-image should switch from none to a value.

Here is what i have right now:

function findStyleValue(objectID, styleProp, IEStyleProp) {

var object = [url removed, login to view](objectID)

if ([url removed, login to view]) return [url removed, login to view][IEStyleProp]

else if([url removed, login to view]) {

compStyle = [url removed, login to view](object,'')

return [url removed, login to view](styleProp)

}

}

function showTab(objectID) {

var object1 = [url removed, login to view](objectID)

state = findStyleValue(objectID, 'background-image', 'background-image')

if (state == 'none')

object1.style.background-image = 'url(../../images/[url removed, login to view])'

else {

if (state == 'url(../../images/[url removed, login to view])')

object1.style.background-image = 'none'

else object1.style.background-image = 'url(../../images/[url removed, login to view])'

}

}

semi colons were removed.

This should be simple enough for someone looking for a good review.

Kỹ năng: Bất kì công việc gì, Javascript

Xem thêm: if js, image background, image background removed, change url, change background, bg, background image , image dhtml, style background image, dhtml image, object background, javascript value change, change javascript, javascript url window, css javascript image, need background image, background image css, images change url, return image, property image, change jpg, links image, link change, javascript image change, image stored

Về Bên Thuê:
( 27 nhận xét )

Mã Dự Án: #1897196

Đã trao cho:

MarkovninTeam

can do that

$5 USD trong 0 ngày
(0 Đánh Giá)
0.0