1

net , c#. I am calling a javascript by using following code . `

<script type="text/javascript">
    $(function () {

       $("[src='/pinterest/portals/0/Images/about-person3.jpg']").pinit();
       $("[src='/pinterest/portals/0/Images/about-us-group.jpg']").pinit();
    });
    </script>

My c# code is

<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<br />
<img ID="ImageZoom" runat="server" src='<%# DataBinder.Eval(Container.DataItem, "ImageUrl") %> '  style="display: inline; height:auto; left: 0pt; top: 0pt; width:auto;" />
    <asp:CheckBox ID="CheckBox1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ImageId") %> '  /> 

</ItemTemplate>
</asp:Repeater>`

if i add more images i should call javascript for all images .

0

3 Answers 3

1

You're question is vague at best, but I think this is what you're looking for:

  1. Assign a class to the images that you want to call pinit() on.
  2. Use jQuery's class selector to retrieve the appropriate objects.

    <img ID="ImageZoom" class='pinitPlease' runat="server" ... />
    
    $(function () {
        $(".pinitPlease").pinit();
    });
    

Sign up to request clarification or add additional context in comments.

Comments

0

assuming you want to zoom images that are located in /pinterest/portals/0/Images/

you can adapt your jquery selector to select those imgages that start with that path

$("[src^='/pinterest/portals/0/Images/']").pinit();

Comments

0

All your images will have the word "ImageZoom" in their ID, so you can make a selector by that and find all images together.

$("[id*='ImageZoom']").pinit();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.