@{
= "waterfall flow";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section header{
<script src="~/Scripts/jquery-ui-1.8."></script>
<style type="text/css">
.* {
margin:0px;
padding:0px;
}
body {
margin-left:auto;
margin-right:auto;
}
.ClearBoth {
clear:both;
}
#bodyContent {
width:1400px;
margin-left:auto;
margin-right:auto;
}
#head {
width:100%;
height:50px;
margin-bottom:10px;
}
#LefMenue {
width:20%;
height:500px;
float:left;
}
#RightContent {
width:75%;
float:right;
border: thin solid #333;
}
#Footer {
margin-top:10px;
width:100%;
height:40px;
}
.GreyBlock {
border: thin solid #333;
background-color:#CCC;
width:100%;
}
.Item {
float: left;
width: 230px;
margin:5px;
border: 1px solid #CCC;
}
</style>
}
<div >
<div class="GreyBlock">
<h1>Head</h1>
</div>
<div>
<!--Left-->
<div class="GreyBlock">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
</div>
<!----right-->
<div >
<div >
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
<div class="Item">
<dl>
<dt>
<img src="~/Content/" /></dt>
<dd>What's up with you</dd>
</dl>
</div>
</div>
</div>
<div class="ClearBoth"></div>
</div>
<div class="loading-wrap">
<span class="loading">Loading, please wait...</span>
</div>
<div class="ClearBoth"></div>
<div class="GreyBlock"></div>
</div>
@section scripts{
<script type="text/javascript">
var myContainer = $("#ProductList");
//The user drags the scrollbar and ajax loads data once when it reaches the bottom
var loading = $("#loading").data("on", false);//Add to add attribute on to loading div to determine that ajax request is executed
$(window).scroll(function () {
if ($("#loading").data("on"))//
{
return;
}
var isButtom = $(document).scrollTop() > ($(document).height() - $(window).height() - $("#Footer").height());
if (isButtom) {//The page has been dragged to the bottom
//Load more data
("on",true).fadeIn();
$.get("@("GetData","Product")", function (data) {
var html = CreateHtml(data);
var $newElems = $(html).css({ opacity: 0 }).appendTo(myContainer);
$({ opacity: 1 },3000);
("on", false);
();
},"json");
}
});
function CreateHtml(data) {
var html = "";
if ($.isArray(data)) {
for (var i in data) {
//html += "<div class=\"Item\" style=\"height:"+data[i]+"px\">";
html += "<div class=\"Item\">";
html += "<dl>";
html += "<dt>";
html += "<img src=\"../Content/\" />";
html += "</dt>";
html += "<dd>";
html += "What's up with you " + data[i];
html += "</dd>"
html += "</dl>"
html += "</div>"
}
}
return html;
}
</script>
}