Dan Sweeney
Posts: 0
Joined: Thu Feb 21, 2013 9:49 am

Setting button text changes height

I am changing the text on some buttons as the page loads using:

Tiggzi("mButDay1").text("Day 1 - Shoulders");

but it is then reducing the button height.

How can I make it keep the same size?

Thanks

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Setting button text changes height

Hi Dan.
Try this
codeTiggzi("mButDay1").find('.ui-btn-text').text("Day 1 - Shoulders");/code

Dan Sweeney
Posts: 0
Joined: Thu Feb 21, 2013 9:49 am

Setting button text changes height

That works great, thanks again

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Setting button text changes height

I tried running this in a mapped grid loop in order to target the button component. Each result is supposed to have a different value and the JS below will change the button color if the Value is "Connected"

if(value==="connected"){
$("a[dsid='connected_button2'] .ui-btn-text").css("background-image","linear-gradient(#15e109, #15e109)");
$("a[dsid='connected_button2'] .ui-btn-text").text("View Profile");
}else{
console.log("connection status is"+' '+value);
}

This just seems to change ALL the buttons to the same color and text, not each individually based on the values from the grid loop.
Is there a better way to target for a button in a loop for CSS Changes?
Thanks
Matt
Image Image

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

Setting button text changes height

Hello,

You can use this code:
$(element).css("background-image","linear-gradient(#15e109, #15e109)");
It'll allow refer to each button separately from the mapping

Return to “Issues”