EasyUI Forum
May 16, 2024, 10:06:27 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Styling number spinner and datebox with CSS  (Read 6428 times)
twhiter
Newbie
*
Posts: 1


View Profile Email
« on: January 30, 2014, 11:21:13 AM »

I have a web site where I am using jQuery EasyUI number spinners and date boxes.

In order to support Smart Phones, Tablets and Laptops, I am using CSS Media Queries to style based on the screen size.

When I view the page on a tablet (i.e. my iPad) I need to adjust the height of the controls. If I add a 'style="height:20px;width:50px"' to the HTML markup it seems to work.

However, I need to define the width and height in the style sheet and not the mark up. And allow a larger font size. I can't get this to work.

Example: The following works :-

<input id="numberspinner" name="pettargetweight" class="easyui-numberspinner" style="height:20px:width:50px;"

If I remove the 'style=' tag and define the following in the stylesheet, it doesn't work.

#numberspinner {
        height:20px;
   width:50px;
}

Does anyone have experience or can help me find how I can adjust these sizes for display on the various devices?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 31, 2014, 04:59:56 AM »

The possible solution is to override $.fn.numberspinner.parseOptions function.
Code:
<script>
$.fn.numberspinner.parseOptions = function(target){
var t= $(target);
return $.extend({},$.fn.spinner.parseOptions(target),$.fn.numberbox.parseOptions(target),{
width: t.outerWidth(),
height:t.outerHeight()
})
}

</script>
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!