Home > front end >  jQuery
jQuery

Time:10-20

Want to also change the background image and background color:
$(this). The CSS (" background ", "red url (" image") ");
Emmm that doesn't work. What should write...

CodePudding user response:

Can, you should pay attention to quote the nesting problems
$(this). The CSS (" background ", "red url (' images')");
Or
$(this). The CSS (" background ", "red url (" image \ ") ");

CodePudding user response:

Image path with single quote
$(this). The CSS (" background ", "red url (' images')");

CodePudding user response:

reference 1/f, the sky wave response:
yes, you should pay attention to quote nesting problems
$(this). The CSS (" background ", "red url (' images')");
Or
$(this). The CSS (" background ", "red url (" image \ ") ");

Well, but was covered by the background color image is added to the...

CodePudding user response:

reference 4 floor weixin_45910205 response:
Quote: reference 1/f, the sky wave response:
yes, you should pay attention to Quote nesting problems
$(this). The CSS (" background ", "red url (' images')");
Or
$(this). The CSS (" background ", "red url (" image \ ") ");

Well, but was covered by the background color image is added to the...


Should be pictures covered the background color

CodePudding user response:

refer to fifth floor of the sky wave response:
Quote: refer to 4th floor weixin_45910205 response:

Quote: reference 1/f, the sky wave response:
yes, you should pay attention to Quote nesting problems
$(this). The CSS (" background ", "red url (' images')");
Or
$(this). The CSS (" background ", "red url (" image \ ") ");

Well, but was covered by the background color image is added to the...


Images should be covered the background color.

Color comes out the image

CodePudding user response:

refer to 6th floor weixin_45910205 response:
Quote: refer to the 5 floor sky waves reply:
Quote: refer to 4th floor weixin_45910205 response:

Quote: reference 1/f, the sky wave response:
yes, you should pay attention to Quote nesting problems
$(this). The CSS (" background ", "red url (' images')");
Or
$(this). The CSS (" background ", "red url (" image \ ") ");

Well, but was covered by the background color image is added to the...


Images should be covered the background color.

Color comes out the picture

Only set the picture show?
$(this). The CSS (" background ", "url (' images')");

CodePudding user response:

refer to 7th floor sky waves reply:
Quote: refer to the sixth floor weixin_45910205 response:

Quote: refer to the 5 floor sky waves reply:
Quote: refer to 4th floor weixin_45910205 response:

Quote: reference 1/f, the sky wave response:
yes, you should pay attention to Quote nesting problems
$(this). The CSS (" background ", "red url (' images')");
Or
$(this). The CSS (" background ", "red url (" image \ ") ");

Well, but was covered by the background color image is added to the...


Images should be covered the background color.

Color comes out the picture

Only set the picture show?
$(this). The CSS (" background ", "url (' images')");

Emmm
Don't show!
embarrassed

CodePudding user response:

refer to the eighth floor weixin_45910205 response:
emmm
Don't show!
Embarrassing

That is the wrong picture address