Bug Tracker

Modify

Ticket #4249 (closed bug: invalid)

Opened 4 years ago

Last modified 2 years ago

Odd string to number conversion

Reported by: chrisbarr Owned by:
Priority: low Milestone: 1.4
Component: css Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

If I have a z-index of 100 on an item and I run the following code:

$("#myThing").css("z-index",$("#myThing").css("z-index")+100);

the new z-index is 100100 not 200 as I would have expected.

Change History

comment:1 Changed 4 years ago by chrisbarr

Several people have told me this is the expected behavor and not a bug. $(x).css() always returns a string. I need to use parseInt() to convert it to an integer.

Please close this ticket - sorry for the trouble.

comment:2 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

comment:3 Changed 2 years ago by jitter

  • Priority changed from minor to low
  • Component changed from unfiled to css

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.