0
Z odpowiedzią
Derive Image Source & Assign to Variable?
Is it possible to determine an image's current source and assign this string to a variable? Or is the image source property write only?
Customer support service by UserEcho
This also works for urls [object:PICTURE.url]
<assign property="var:imgSource" value="[object:PICTURE.source]" />
<alert message="Image Source: [var:imgSource]"/>
I did some research and it does appear that this IS a write only object property. I have corrected the documentation.
I think the rationale here is that you are defining that source upfront or using an assign to determine it, so you should always be in a position to know what it is. If you have it set upfront, you can assign your imgSource var oninit and if it changes at any point during an action you can reassign the var as well.
If there were a way to read an image's source I could include just 200 image tags and swap between five different images for each depending on what the current one is. Else, I'll have to include 1,000 separate image tags for my 200 preferences with five options each. :/
Can you help me understand the workflow? Do you have 800 images in your app that all display oninit?
Is there a way for me to paste the code here?