Đ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 nhiều hơn: if js, url change, 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

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

ID dự án: #1897196

Được trao cho:


can do that

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