SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

element.hide(); no longer working

I'm mapping a value back from a web service to the visibility element on an image. Originally I had values returned of "false" that didn't have an impact on the display. A few weeks (months?) ago I saw a post to add the following javascript to the returned value:

if (value == 'false'){
element.hide();
}

When implemented several weeks ago in another area on this project, it worked great. Now that I'm using this same approach on another area, it no longer works.

The javascript executes when triggered and rather than hide the element, it changes the image element to "display: block". I had tried the following:

if (value == 'false'){
Tiggzi('img_archive').css('display', 'none');
}

But this didn't do anything. Something changed recently in Tiggzi's ability to hide elements. Let me know how to correct the problem.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

element.hide(); no longer working

code
if (value == 'false'){
element.hide();
}
/code

what is the type of 'element' component"

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

element.hide(); no longer working

it's an image.

Ted L
Posts: 0
Joined: Tue Feb 19, 2013 8:03 am

element.hide(); no longer working

I had the same problem. One of the girls told me to try this and it works fine now.

Tiggzi('mobileimage_2').css('margin', 'auto');
Tiggzi('mobileimage_2').css('display', 'block');

Ted L
Posts: 0
Joined: Tue Feb 19, 2013 8:03 am

element.hide(); no longer working

sorry... I meant this:

Tiggzi("panel_8").hide();

I see I'm probably not helping, the other code was for a centering problem I was having.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

element.hide(); no longer working

If value is an image, then it will return the image URL in mapping (or empty if image is not there). But, it shouldn't be equal to 'false'.

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

element.hide(); no longer working

I guess I misunderstood the question. The web service returns the URL for the image (that works fine). The web service also returns whether or not the image should be displayed (returning either "true" or "false") that is mapped to the component's "visible" attribute. I also added the javascript (since the "false" on the visibility didn't work). I've attached a screen shot below. Thanks for your help.

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

element.hide(); no longer working

Ted,

Thanks for the info. But that didn't work either (it just changes the display type of the image to "block").

Max - I guess I misunderstood your question. The web service returns the URL for the image (that works fine). The web service also returns whether or not the image should be displayed (returning either "true" or "false") that is mapped to the component's "visible" attribute. I also added the javascript (since the "false" on the visibility didn't work). I've attached a screen shot below. Thanks for your help.
Image

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

element.hide(); no longer working

Hi Steve,

To make component invisible you can for "Visible" property in mapping use JavaScript code that will return "false" or "hidden" string.

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

element.hide(); no longer working

Yeah that's what I was doing... I was using....

if (value == 'false'){
element.hide();
}

But that javascript would only change the display type of the component from inline to block (it doesn't hide anymore). A few weeks ago it worked, but not anymore. I had also applied this same approach with hiding a button in the same app. I haven't changed the code, but it no longer works for the button either.

Help me understand how to make the image invisible.

Return to “Issues”