Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

javascript - doesnt work in IE -


here javasript:

            function random_imglink() {             var myimages = [                 {image: "/documents/templates/projedepo/banner/canon.jpg", url: "/index.cfm?fuseaction=objects2.detail_product&product_id=612&stock_id=612"},                 {image: "/documents/templates/projedepo/banner/indigovision.jpg", url: "http://www.url2.com"}             ];              var ry=math.floor(math.random()*myimages.length);              var randomimage = myimages[ry];              var randomimagelink = '<a id="random_link" href="' + randomimage.url + '"><img style="z-index:1;position:absolute; left:70px; top:360px;" border="0" align="absmiddle" src="/documents/templates/projedepo/banner/daha_fazlasi.jpg" /></a><img id="random_img" src="'+randomimage.image+'" height="420" width="964" />';             document.getelementbyid("image2").innerhtml = randomimagelink;             }  $(function() {   $(".image2").click(function() {   var image = $(this).attr("rel");     var rel = $('#random_img').hide().fadein('slow').attr('src');     $('#random_img').attr('src', image);    var randomlink = $(this).attr("href");   $('#random_link').attr('href',randomlink);      var image2 = $('#random_img').attr('src');     $("#thumb2 img").removeclass("open");     $("#thumb2 a[rel='" + image2 + "'] img").addclass("open");     return false;   });  });    $(document).ready(function() {    var image2 = $('#random_img').attr('src');    $("#thumb2 a[rel='" + image2 + "'] img").addclass("open");  });                 random_imglink() 

here html:

<div id="slider_container">     <div id="image2">here written sript</div> <div id="thumb2">  <a href="/index.cfm?fuseaction=objects2.detail_product&product_id=612&stock_id=612" rel="/documents/templates/projedepo/banner/canon.jpg" class="image2" ><img title="canon" class="slider_thumb" src="/documents/templates/bilgiteknolojileri/images/t_flash/t1.png" border="0"/></a> <a href="http://www.url2.com" rel="/documents/templates/projedepo/banner/indigovision.jpg" class="image2"><img title="indigovision" class="slider_thumb" src="/documents/templates/bilgiteknolojileri/images/t_flash/t2.png" border="0"/></a>  </div></div> 

in internet explorer, not in firefox or opera, @ first works fine, random image displayed , thumbnails ok, when click thumbnail, random image turns in frame overflows, this: http://vteam.net.ru/_fr/11/1923928.jpg

the suspect thing see this:

$(document).ready(function() {    var image2 = $('#random_img').attr('src');    $("#thumb2 a[rel='" + image2 + "'] img").addclass("open");  });                 random_imglink() 

in html-source wrote

    <div id="image2">here written sript</div> 

...so assume script placed there. can problem.replace code above with

$(document).ready(function() {        var image2 = $('#random_img').attr('src');        $("#thumb2 a[rel='" + image2 + "'] img").addclass("open");        random_imglink();      }); 

(move call of random_imglink() ready-function). otherwise it's called immediately, there element manipulated (#image2) not closed yet, may result in error in msie.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -