For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 4 replies, 2 voices, and was last updated 12 years, 1 month ago by
rick.gommers.
-
AuthorPosts
-
rick.gommersMemberPlease have a look at this image:

I have a multipage template. The ‘multiPageTmpl25’ as seen in the image replaces templates (from which the user can choose) in my app.
These templates consists of 2 images, one larger and one smaller. The smaller one has allways the highest number. I want to transfer the source of this image (with the highest number) to another screen. I know how to do that, the thing I need is the src of my image.
I have onPageChange event which returns the id of the template placeholder, like Tmpl1_25mm (see image above).
Is it possible to get the src of the image with the highest number which resides in that template placeholder?
Difficult to explain. I hope you understand it. Thx in advance!
January 31, 2014 at 1:42 pm #346636
Code_AMemberI am not sure I completely understand, but here is how you can get the source of your image:
alert($('#m1-screen-image1').attr('src'));Here is how you can change an image source:
$('#m1-screen-image1').attr('src', newImagePath);Hope this helps.
January 31, 2014 at 2:02 pm #346638
rick.gommersMemberHi Code A,
Maybe look at the code suggestion below first, before reading my description. I think I make it more difficult then it is..
Thx for your suggestion.
The problem is I don’t know the id of the image I want before the user clicks on the template placeholder (Tmpl1_25mm, Tmpl2_25mm, etc).
I have 60 templates right now with many more to come, so I can’t make an if statement to get the id of every template yet to come.
Instead, I’d like to receive the id of the image with the highest number, when I click on it’s corresponding template placeholder (Tmpl1_25mm). check the image in previous post!
Right now, I have an onPageChange event on the parent multiPageTmpl25. This returns the Id of the template placeholder when clicked upon:
var templateId = ($(newPage).attr('id')); templChanged(templateId); function templChanged(templateId) { alert(templateId); }Alert returns template placeholder as in: screen1-Tmpl1_25mm, screen2-Tmpl5_20mm, etc.
I want to do something like
$('#templateId').find('<img>')And then return the image with the highest id number.
January 31, 2014 at 2:12 pm #346639
Code_AMemberI still may be confused, but what about just coming up with a naming convention for each image within the templates? For example, <templateID>_1 & <templateID>_2, etc. This way you would know all the image names for each template.
January 31, 2014 at 2:29 pm #346641
rick.gommersMemberah yes naming is a disaster. I’ll have to look at that 🙂
But I’m thinking way too difficult xD I have my solution:
function templChanged(templateId) { alert(templateId); var ringImages = $('img', templateId) var smallImage = ringImages.filter(function(){ return ($(this).width() < 140) ) alert(smallImage); }) }Thx for your help! Together we always find a solution 🙂
-
AuthorPosts
