- This topic has 5 replies, 2 voices, and was last updated 10 years, 6 months ago by AdamRogan.
-
AuthorPosts
-
AdamRoganMemberdynamic list demo
how would you go about showing one image on list view and a different image in details page?
im parsing a xml file.
<root>
<item>
<title>xxxxxxxxxx</title>
<thumb>http://image.png</thumb>
<link>http://someone.com.</link>
<image>http://image1.png</image>
</item>
so i want the <thumb> image in list view and the <image> in details page. i can do either one but am unable to do both together.
Or is their a way to just show the top 150px of image in list view then show full image in details.
js
$(clone).attr(“data-listitem-index” , i);
$(“div[id*=txtTitle]” , clone).text( item[“title”] );
$(“div[id*=txtDesc]” , clone).text( item[“description”] );
$(“div[id*=htmDesc]” , clone).html( item[“description”] );
$(“img[id*=imgImage]” , clone).attr( “src” , item[“image”] );$(“div[id*=txtTitle]” , clone).css(“overflow” , “hidden”);
$(“div[id*=txtDesc]” , clone).css(“overflow” , “hidden”);var title = item[“title”];
var desc = item[“desc”];
var image = item[“image”];$(“#m1-view_game-txtAppTitle”).text(title);
$(“#m1-view_game-txtAppType”).html(desc);
$(“#m1-view_game-img”).attr(“src” , image);title: $this.find(“title”).text(),
desc: $this.find(“description”).text(),
image: $this.find(“image”).text(),
thnx in advance
support-octavioMemberHi adrog,
Does your xml file contain url to both images? If yes, have you tried something like:
$(“img[id*=imgImage]” , clone).attr( “src” , item[“thumb”] );
…
…
var image = item[“image”];
$(“#m1-view_game-img”).attr(“src” , image);
AdamRoganMemberYea tried that!
yes i have thumb link and image link.
when i am able to retrieve thumb image, it shows in details page as well.
Im stuck on getting both to work at once. Not sure what i am doing incorrect.
AdamRoganMemberanother option?
is their a way i can show or display top half of image in list item images, and show the whole image in details page.Also how can i create a gap between the list item widgets
thanks
AdamRoganMemberok worked out the thumb image thanks very much for your help.
to get the thumb image i did/
$(“img[id*=imgImage]” , clone).attr( “src” , item[“thumb”] );
thumb: $this.find(“thumb”).text(),Now one last thing i need help with is creating a gap between the list items.
would that be in the css file or in the custom javascript file?
i have been tinkering with both but have not achieved what i am after.
i want to have probably 5 to 10 px gap between list items.
help would be awesome thnx.
AdamRoganMemberclose this i worked it out
cheers -
AuthorPosts