Jquery innerfade using Damp for a imageslider using crops
For some reason this just stops working. is there a bug in the Image cropper? If i delete the crops and readd them it will work for a while.
@{ if (Model.HasValue("carouselImages")) { dynamic mediaItems = Model.carouselImages.mediaItem; if (mediaItems.Count() != 0) { <ul id="Rotate"> @foreach (var item in mediaItems) { var image = item.Image; <li> @* If the type of the mediacropper is not XML (but a string) then there are no crops defined, so I should not try to find the crops. *@ @{ var crops = image.mediaCropper;} @if (crops.GetType().ToString() != "System.String") { <img src="@crops.Find("@name", "Rotator").url" alt="@image.nodeName"/> } </li> } </ul> } } }
Jquery innerfade using Damp for a imageslider using crops
For some reason this just stops working. is there a bug in the Image cropper? If i delete the crops and readd them it will work for a while.
@{
if (Model.HasValue("carouselImages")) {
dynamic mediaItems = Model.carouselImages.mediaItem;
if (mediaItems.Count() != 0)
{
<ul id="Rotate">
@foreach (var item in mediaItems)
{
var image = item.Image;
<li>
@*
If the type of the mediacropper is not XML (but a string) then there
are no crops defined, so I should not try to find the crops.
*@
@{ var crops = image.mediaCropper;}
@if (crops.GetType().ToString() != "System.String")
{
<img src="@crops.Find("@name", "Rotator").url" alt="@image.nodeName"/>
}
</li>
}
</ul>
}
}
}
What error are you getting? Could you perhaps post part of the xml of your node (found in umbraco.config)?
Jeroen
It is like is does not see the UL just shows the DIV
]]></bodyText>
<mediaItem />
<carouselImages>
<DAMP fullMedia="">
<mediaItem>
<Image id="1752" version="79885526-dd3f-4511-ab55-a68145edb975" parentID="1192" level="3" writerID="7" nodeType="1032" template="0" sortOrder="9" createDate="2012-06-17T11:53:39" updateDate="2012-06-17T11:53:39" nodeName="j7" urlName="j7" writerName="GunShop" nodeTypeAlias="Image" path="-1,1207,1192,1752">
<umbracoFile>/media/28796/pocketwatches2.jpg</umbracoFile>
<umbracoWidth>1024</umbracoWidth>
<umbracoHeight>768</umbracoHeight>
<umbracoBytes>290584</umbracoBytes>
<umbracoExtension>jpg</umbracoExtension>
<thumbnail>/media/28796/pocketwatches2_180x180.jpg</thumbnail>
<fullImage>/media/28796/pocketwatches2_1024x1024.jpg</fullImage>
<mediaCropper>
<crops date="2012-06-18T15:35:55">
<crop name="Rotator" x="0" y="43" x2="1024" y2="723" url="/media/28796/pocketwatches2_Rotator.jpg" />
<crop name="Homepage" x="0" y="41" x2="1023" y2="342" url="/media/28796/pocketwatches2_Homepage.jpg" />
<crop name="Header" x="0" y="230" x2="1024" y2="537" url="/media/28796/pocketwatches2_Header.jpg" />
</crops>
</mediaCropper>
</Image>
</mediaItem>
<mediaItem>
<Image id="1747" version="c9fd31e8-87c2-4bbe-b168-0954d1995c37" parentID="-1" level="1" writerID="7" nodeType="1032" template="0" sortOrder="51" createDate="2012-06-17T11:21:03" updateDate="2012-06-17T11:21:03" nodeName="j2" urlName="j2" writerName="GunShop" nodeTypeAlias="Image" path="-1,-21,1747">
<umbracoFile>/media/28756/618-2.jpg</umbracoFile>
<umbracoWidth>1024</umbracoWidth>
<umbracoHeight>752</umbracoHeight>
<umbracoBytes>308810</umbracoBytes>
<umbracoExtension>jpg</umbracoExtension>
<thumbnail>/media/28756/618-2_180x180.jpg</thumbnail>
<fullImage>/media/28756/618-2_1024x1024.jpg</fullImage>
<mediaCropper>
<crops date="2012-06-18T10:45:40">
<crop name="Rotator" x="0" y="35" x2="1024" y2="715" url="/media/28756/618-2_Rotator.jpg" />
<crop name="Homepage" x="0" y="0" x2="1024" y2="300" url="/media/28756/618-2_Homepage.jpg" />
<crop name="Header" x="0" y="222" x2="1024" y2="529" url="/media/28756/618-2_Header.jpg" />
</crops>
</mediaCropper>
</Image>
</mediaItem>
<mediaItem>
<Image id="1748" version="cf779f48-0644-4e31-ba18-fc4f633c6be7" parentID="1192" level="3" writerID="7" nodeType="1032" template="0" sortOrder="6" createDate="2012-06-17T11:51:10" updateDate="2012-06-17T11:51:10" nodeName="j3" urlName="j3" writerName="GunShop" nodeTypeAlias="Image" path="-1,1207,1192,1748">
<umbracoFile>/media/28764/618-5.jpg</umbracoFile>
<umbracoWidth>1024</umbracoWidth>
<umbracoHeight>625</umbracoHeight>
<umbracoBytes>239112</umbracoBytes>
<umbracoExtension>jpg</umbracoExtension>
<thumbnail>/media/28764/618-5_180x180.jpg</thumbnail>
<fullImage>/media/28764/618-5_1024x1024.jpg</fullImage>
<mediaCropper>
<crops date="2012-06-18T10:46:04">
<crop name="Rotator" x="0" y="275" x2="1024" y2="563" url="/media/28764/618-5_Rotator.jpg" />
<crop name="Homepage" x="0" y="0" x2="1024" y2="300" url="/media/28764/618-5_Homepage.jpg" />
<crop name="Header" x="0" y="158" x2="1024" y2="465" url="/media/28764/618-5_Header.jpg" />
</crops>
</mediaCropper>
</Image>
</mediaItem>
<mediaItem>
<Image id="1749" version="9bfce022-3400-4675-acae-9a3ccbec4240" parentID="1192" level="3" writerID="7" nodeType="1032" template="0" sortOrder="7" createDate="2012-06-17T11:52:22" updateDate="2012-06-17T11:52:22" nodeName="j4" urlName="j4" writerName="GunShop" nodeTypeAlias="Image" path="-1,1207,1192,1749">
<umbracoFile>/media/28772/618-6.jpg</umbracoFile>
<umbracoWidth>1024</umbracoWidth>
<umbracoHeight>373</umbracoHeight>
<umbracoBytes>147322</umbracoBytes>
<umbracoExtension>jpg</umbracoExtension>
<thumbnail>/media/28772/618-6_180x180.jpg</thumbnail>
<fullImage>/media/28772/618-6_1024x1024.jpg</fullImage>
<mediaCropper>
<crops date="2012-06-18T10:50:38">
<crop name="Rotator" x="0" y="52" x2="1024" y2="340" url="/media/28772/618-6_Rotator.jpg" />
<crop name="Homepage" x="0" y="39" x2="1024" y2="339" url="/media/28772/618-6_Homepage.jpg" />
<crop name="Header" x="0" y="32" x2="1024" y2="339" url="/media/28772/618-6_Header.jpg" />
</crops>
</mediaCropper>
</Image>
</mediaItem>
<mediaItem>
<Image id="1746" version="6e15f243-b7d8-4e17-825d-4e98d9d9bc11" parentID="1192" level="3" writerID="7" nodeType="1032" template="0" sortOrder="4" createDate="2012-06-17T11:20:32" updateDate="2012-06-17T11:20:32" nodeName="j1" urlName="j1" writerName="GunShop" nodeTypeAlias="Image" path="-1,1207,1192,1746">
<umbracoFile>/media/28748/618-13.jpg</umbracoFile>
<umbracoWidth>1024</umbracoWidth>
<umbracoHeight>711</umbracoHeight>
<umbracoBytes>328488</umbracoBytes>
<umbracoExtension>jpg</umbracoExtension>
<thumbnail>/media/28748/618-13_180x180.jpg</thumbnail>
<fullImage>/media/28748/618-13_1024x1024.jpg</fullImage>
<mediaCropper>
<crops date="2012-06-18T10:45:17">
<crop name="Rotator" x="0" y="15" x2="1024" y2="695" url="/media/28748/618-13_Rotator.jpg" />
<crop name="Homepage" x="0" y="0" x2="1024" y2="300" url="/media/28748/618-13_Homepage.jpg" />
<crop name="Header" x="0" y="201" x2="1024" y2="508" url="/media/28748/618-13_Header.jpg" />
</crops>
</mediaCropper>
</Image>
</mediaItem>
<mediaItem>
<Image id="1751" version="f4d5c3cf-af33-411b-8c47-77574200b08c" parentID="1192" level="3" writerID="7" nodeType="1032" template="0" sortOrder="3" createDate="2012-06-17T11:53:18" updateDate="2012-06-17T11:53:18" nodeName="j6" urlName="j6" writerName="GunShop" nodeTypeAlias="Image" path="-1,1207,1192,1751">
<umbracoFile>/media/28788/618-8.jpg</umbracoFile>
<umbracoWidth>1024</umbracoWidth>
<umbracoHeight>771</umbracoHeight>
<umbracoBytes>362081</umbracoBytes>
<umbracoExtension>jpg</umbracoExtension>
<thumbnail>/media/28788/618-8_180x180.jpg</thumbnail>
<fullImage>/media/28788/618-8_1024x1024.jpg</fullImage>
<mediaCropper>
<crops date="2012-06-18T10:46:36">
<crop name="Rotator" x="0" y="253" x2="1024" y2="541" url="/media/28788/618-8_Rotator.jpg" />
<crop name="Homepage" x="0" y="264" x2="1023" y2="564" url="/media/28788/618-8_Homepage.jpg" />
<crop name="Header" x="0" y="231" x2="1024" y2="538" url="/media/28788/618-8_Header.jpg" />
</crops>
</mediaCropper>
</Image>
</mediaItem>
<mediaItem>
<Image id="1753" version="1190a91e-fb97-44cc-acf1-04f34c29f8f8" parentID="-1" level="1" writerID="7" nodeType="1032" template="0" sortOrder="50" createDate="2012-06-17T11:54:31" updateDate="2012-06-17T11:54:31" nodeName="j8" urlName="j8" writerName="GunShop" nodeTypeAlias="Image" path="-1,-21,1753">
<umbracoFile>/media/28804/618-10.jpg</umbracoFile>
<umbracoWidth>1024</umbracoWidth>
<umbracoHeight>830</umbracoHeight>
<umbracoBytes>249255</umbracoBytes>
<umbracoExtension>jpg</umbracoExtension>
<thumbnail>/media/28804/618-10_180x180.jpg</thumbnail>
<fullImage>/media/28804/618-10_1024x1024.jpg</fullImage>
<mediaCropper>
<crops date="2012-06-18T10:47:04">
<crop name="Rotator" x="0" y="142" x2="1023" y2="430" url="/media/28804/618-10_Rotator.jpg" />
<crop name="Homepage" x="0" y="299" x2="1024" y2="598" url="/media/28804/618-10_Homepage.jpg" />
<crop name="Header" x="0" y="261" x2="1024" y2="568" url="/media/28804/618-10_Header.jpg" />
</crops>
</mediaCropper>
</Image>
</mediaItem>
<mediaItem>
<Image id="1754" version="93a2418c-64eb-4b11-8947-4f3b253cbd17" parentID="1192" level="3" writerID="7" nodeType="1032" template="0" sortOrder="1" createDate="2012-06-17T11:56:05" updateDate="2012-06-17T11:56:05" nodeName="j9" urlName="j9" writerName="GunShop" nodeTypeAlias="Image" path="-1,1207,1192,1754">
<umbracoFile>/media/28812/618-11.jpg</umbracoFile>
<umbracoWidth>1024</umbracoWidth>
<umbracoHeight>620</umbracoHeight>
<umbracoBytes>221349</umbracoBytes>
<umbracoExtension>jpg</umbracoExtension>
<thumbnail>/media/28812/618-11_180x180.jpg</thumbnail>
<fullImage>/media/28812/618-11_1024x1024.jpg</fullImage>
<mediaCropper>
<crops date="2012-06-18T10:47:26">
<crop name="Rotator" x="0" y="152" x2="1023" y2="441" url="/media/28812/618-11_Rotator.jpg" />
<crop name="Homepage" x="0" y="168" x2="1024" y2="468" url="/media/28812/618-11_Homepage.jpg" />
<crop name="Header" x="0" y="156" x2="1024" y2="463" url="/media/28812/618-11_Header.jpg" />
</crops>
</mediaCropper>
</Image>
</mediaItem>
<mediaItem>
<Image id="1755" version="6a2f5c30-639e-4b82-b483-403a0711a75c" parentID="-1" level="1" writerID="7" nodeType="1032" template="0" sortOrder="49" createDate="2012-06-17T11:56:29" updateDate="2012-06-17T11:56:29" nodeName="j10" urlName="j10" writerName="GunShop" nodeTypeAlias="Image" path="-1,-21,1755">
<umbracoFile>/media/28820/618-12.jpg</umbracoFile>
<umbracoWidth>1024</umbracoWidth>
<umbracoHeight>691</umbracoHeight>
<umbracoBytes>178775</umbracoBytes>
<umbracoExtension>jpg</umbracoExtension>
<thumbnail>/media/28820/618-12_180x180.jpg</thumbnail>
<fullImage>/media/28820/618-12_1024x1024.jpg</fullImage>
<mediaCropper>
<crops date="2012-06-18T10:47:45">
<crop name="Rotator" x="0" y="5" x2="1024" y2="685" url="/media/28820/618-12_Rotator.jpg" />
<crop name="Homepage" x="0" y="0" x2="1024" y2="300" url="/media/28820/618-12_Homepage.jpg" />
<crop name="Header" x="0" y="191" x2="1024" y2="498" url="/media/28820/618-12_Header.jpg" />
</crops>
</mediaCropper>
</Image>
</mediaItem>
</DAMP>
</carouselImages>
is working on a reply...