Click here to Skip to main content
15,909,332 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi Dear my Friends
i want to show part of picture
but i dont Know how!!!
only not using with OverFolw:Hidden;

thanks very much
Posted

1 solution

jQuery UI does this very well. You could look in to that. For example this is from the jQuery ui's theme file

CSS
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }

/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }


Note the width & height in the ui-icon class and background-position attribute in the "positioning" section.

For example to use ui-icon-carat-1-n class the following could be done:

HTML
<span class="ui-icon ui-icon-carat-1-n" style="display:inline-block"></span>


Refer to this SO question which discusses about using jQuery UI icons:

http://stackoverflow.com/questions/7290857/using-jquery-ui-icons[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900