Hi, Steven!
1. Is it possible to put a image in a button?
2. I am migrating a system that has a main page like . Can I do it in nuBuilder?
Thanks
dePaula Jr.
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Button with image
-
- Posts: 3
- Joined: Sat Jan 28, 2012 11:29 pm
- Location: Brazil
-
- Posts: 84
- Joined: Mon Jul 04, 2011 12:52 am
Re: Button with image
Here is one way how it could be done with jquery.
The code goes to CustomCode/Javascript.
(The function 'buttonPicture' assumes that you have a 'icons' folder in productionnu2 folder, where the icons are)

But way cooler thing u could to with it is to add custom value to a button .
Like the button 'Test button (3)' where the number 3 could be a count result from MySql query.
i hope it helps
The code goes to CustomCode/Javascript.
(The function 'buttonPicture' assumes that you have a 'icons' folder in productionnu2 folder, where the icons are)
Code: Select all
function nuLoadThis(){
buttonPicture("#nuActionSave","disk.png");
buttonPicture("#nuActionClone","disk_multiple.png");
buttonPicture("#nuActionDelete","delete.png");
}
function buttonPicture(id,pic){
$(id).css("padding-left","25px");
$(id).css("background-image","url(icons/"+pic+")");
$(id).css("background-repeat","no-repeat");
$(id).css("background-position","5px 4px");
}

But way cooler thing u could to with it is to add custom value to a button .
Like the button 'Test button (3)' where the number 3 could be a count result from MySql query.
Code: Select all
function nuLoadThis(){
var somevalue = 3;
buttonValue("#testButtonFieldName",somevalue);
}
function buttonValue(id,val){
$(id).attr('value', $(id).attr('value')+' ('+val+')');
}
Re: Button with image
zazzium,
This is nice!
With a slight change we you can use images stored in nuBuilder
Steven
This is nice!
With a slight change we you can use images stored in nuBuilder
Code: Select all
function nuLoadThis(){
buttonPicture("#nuActionSave",getImage("disk");
}
function buttonPicture(id,pic){
$(id).css("padding-left","25px");
$(id).css("background-image","url("+pic+")");
$(id).css("background-repeat","no-repeat");
$(id).css("background-position","5px 4px");
}
You do not have the required permissions to view the files attached to this post.