EasyUI Forum
September 19, 2025, 09:13:15 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: images of any size in linkbutton  (Read 8267 times)
korenanzo
Guest
« on: January 28, 2016, 02:48:42 AM »

Hi all,

is it possible to put an image  into a linkbutton without constraint it at 16x16 pixel?

may be using another property instead of iconCls


thanks, Ric
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: January 28, 2016, 07:36:08 PM »

You can set the 'size' property to 'large' to get the large image button.

http://www.jeasyui.com/demo/main/index.php?plugin=LinkButton&theme=default&dir=ltr&pitem=LinkButton%20Size

You also can custom the image and the text on the button.
Code:
var img = '<img src="..." style="width:32px;height:32px;vertical-align:top">';
var txt = '<span style="line-height:32px">Text</span>';
$('#b1').linkbutton({
    text: img+txt
})
Logged
korenanzo
Guest
« Reply #2 on: February 08, 2016, 10:39:42 AM »

Thanks jarry,

I am trying it but have some alignment problems:
how can I have the image centered in the button?

http://jsfiddle.net/teff1wns/10/
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #3 on: February 08, 2016, 05:31:09 PM »

Please set 'width' property to 'auto'.

http://jsfiddle.net/teff1wns/11/
Logged
korenanzo
Guest
« Reply #4 on: February 09, 2016, 12:54:24 AM »

got it !
 
it works, thanks Smiley

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!