kthornbloom / Smoothproducts

A simple, lightweight and responsive product image viewer using jQuery
kthornbloom.com/smoothproducts
185 stars 89 forks source link

Update for use several times in the ASP.NET page #35

Open dimitridup opened 7 years ago

dimitridup commented 7 years ago

Add parameter ctrlId (div ID) to use Smoothproducts several times in the page. For example in a repeater ASP.net

kthornbloom commented 7 years ago

Hi, can you explain a bit more about what you've done here? The plugin should allow for multiple instances by default.

dimitridup commented 7 years ago

Hello,

I have make this modification to use X time Smoothproducts in the same page with controls ASP.NET

Exemple in ASP.net / C# ` //Slide Control

//ASP

<.div class="sp-loading"><.img src="images/sp-loading.gif" alt="">LOADING MAGES //C# protected void lbl_DataBinding(object sender, EventArgs e) { Literal lblimg = (Literal)sender; string file = lblimg.Text; lblimg.Text = "\"\"<\\a>"; } protected void Page_Load(object sender, EventArgs e) { string javascriptInit = "$('#" + slider.ClientID + "').smoothproducts('#" + slider.ClientID + "');"; if (!IsPostBack || !Page.ScriptManager.IsInAsyncPostBack) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Init_" + this.ClientID, javascriptInit, true); } else { ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "Reload_" + this.ClientID, javascriptInit, true); } } // Show Control //ASP //C# protected void Page_Load(object sender, EventArgs e) { repeater1.DataSource = DataSource // Datasouce containe X list images repeater1.DataBind(); }`