Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7038449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:40:14+00:00 2026-05-28T01:40:14+00:00

$(document).ready(function() { $(‘#picture’).css(‘height’, ‘666px’); $(‘#picture’).click(function () { $(this).css(‘background-image’, url(‘../images/picture_2.jpg’)); }); }); in the above

  • 0
$(document).ready(function() {
    $('#picture').css('height', '666px');
    $('#picture').click(function () {
        $(this).css('background-image', "url('../images/picture_2.jpg')");
    });
});

in the above code, the height is successfully changed to 666px but the background image does not change at all (remains the original one).

When I change the background-image to ‘none’ instead of “url(‘../images/picture_2.jpg’)” it does make the background image disappear though.

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:40:15+00:00Added an answer on May 28, 2026 at 1:40 am

    My guess is that the URL you’re putting in is incorrect. The URL should be relative to the page you’re on. I bet your URL is relative to your CSS style sheet. In general, just use absolute paths when doing this in JS.

    You also don’t need the single quotes surrounding the path.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(document).ready(function() { $(tr).removeClass(); $(tr:gt(0)).click(function() { $(this).css(color, red) }); }); .highlight td { background: red;
$(document).ready(function(){ $('.choices a img').click(function(e) { var url = $(this).attr('href') + ' .con_cen2'; $('.con_cen').html('loading...').load('signup.html'); e.preventDefault();
$(document).ready(function() { $(span.link).mouseover(function(e){ $(this.children).css(display,inline); }); }); I'm not a javascript expert, but I've cobbled
$(document).ready(function(e) { $('span#pijlr').click(function(e) { var slide = 500; var variable = $('#gallcont').css('left'); var urechts
$('document').ready(function(){ $('[name=mycheckbox]').live('click', function(){ if($(this).is(':checked')) { alert('it is checked'); } else { alert('it is not
$(document).ready(function() { $('#storefront').click(function() { $(.centerdiv).load(storefront_a.php); $.blockUI({ css: { border: 'none', padding: '15px', backgroundColor: '#000',
$(document).ready(function() { $(#register button[name=btnPosta]).click(function() { console.log('clicked'); thisBtn = $(this); parent = $(this).parent(); name =
$(document).ready(function() { $(#register button[name=btnPosta]).click(function() { console.log('clicked'); thisBtn = $(this); parent = $(this).parent(); name =
$(document).ready(function() { $(".addtophundredwatchlist").click(function() { $.ajax({ type : "GET", url : "/watchlisttophundred/", success : function(data){
$(document).ready(function() { $(button).click(getir); }); function getir() { $.ajax({ dataType: json, url:get.php, success: function(datacall) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.