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

  • SEARCH
  • Home
  • 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 8467201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:34:28+00:00 2026-06-10T15:34:28+00:00

Within a .hover() event, I have the following code: $(this).css(‘background-position’, circle.includesXY(e.pageX, e.pageY) ? ‘bottom’

  • 0

Within a .hover() event, I have the following code:

$(this).css('background-position', circle.includesXY(e.pageX, e.pageY) ? 'bottom' : '');

Could somebody explain how I can add more property:value pairs to .css() without compromising the ternary operator? If not, how should it be rewritten?

  • 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-06-10T15:34:29+00:00Added an answer on June 10, 2026 at 3:34 pm

    .css also accepts an object:

    $(this).css(circle.includesXY(e.pageX, e.pageY)
       ? {
          property1: 'value1',
          property2: 'value2'
       }
       : {
          property1: 'value3',
          property2: 'value4'
       }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: var originalBorder = container.css("border"); container.hover(function(event) { event.stopPropagation(); $(this).css("border", "1px solid
Within my code I have list items like this; <div id=content> <ul class=kwicks> <li
i have two problem with this jquery method : 1- in css hover and
Within a for loop, I'm using the following code to convert from one date
I am using the following code to show social icons on hover: You can
Let's say I have this css, #wrap {width: 190px; padding: 0 10px; border-radius: 10px;
I have the following hover script that handles the sliding down of sub menus
I have to set background images (sprite pngs) within 3 divs. I need the
i wanna dynamically change the link color within a hover event. I got the
I'm trying to attach a hover event handler to a path within an embedded

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.