开发者

this jQuery only works in IE

There`s actually two problems, one of which is browser specific. Any help you can give would be greatly appreciated....

  1. If you click the white box class="submit" box in the middle of the page at this sandbox site the background image changes and a program continues in Internet explorer, but it doesn`t continue in Firefox...

This problem #2 is solved 2. If you click the white box, it's supposed to trigger a change in the background image, but that's not happening in Internet Explorer (--obviously haven't gotten that far in other browsers where the white box is not clickable...)

the original css to establish the background image is

body {background-image:url('kissum.jpg');} 

The unworking code to change the background image is

   var img1 = "url('subway.jp开发者_如何学编程g')";

$(function() {
    $(".submit").click(function(){
$("#body").css({background: img1});  

Note, I have also tried

var img1 = "url('subway.jpg')";

$(function() {
    $(".submit").click(function(){
$("#body").css({background-image: img});   


#body refers to the element with id of body.

Try $('body').css({background: img1});


java.js@31

You have an error on that line where you use #.submit instead of .submit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜