Solved

Trouble with DataList and Lightbox or Colorbox to work with images

Posted on 2011-03-14
8
1,253 Views
Last Modified: 2012-05-11
Hello All,
I am having trouble getting a datalist to use any of the lightbox or colorbox examples. I went as far as used the easy lightbox to work but it's not working either. What happens is that either JQuery or Javascript fire an exception that says: Microsoft JScript runtime error: Object doesn't support this property or method. What am I doing wrong????
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
    <script src="js/prototype.js" type="text/javascript"></script>
	<script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
	<script src="js/lightbox.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript" />
    <script src="Scripts/script.js" type="text/javascript"></script>
    
	
	
    <script type="text/javascript">

    </script>
    <div style="background-color: Gray; color: White;">
        <h1 style="color: White;">
            Photo Gallery</h1>
    </div>
    <div>
        Listing for the photo gallery.
        <asp:DataList runat="Server" ID="rptImages" RepeatColumns="4">
            <ItemTemplate>
                <asp:HyperLink runat="server" NavigateUrl='<%# Eval("FilePath") %>' Title='<%# Eval("FilePath") %>' 
                CssClass="lightbox">
                    <asp:Image runat="Server" 
                                ImageUrl='<%# Eval("FilePath") %>' 
                                Height="200"
                                Width="200" 
                                
                                 />
                </asp:HyperLink>
            </ItemTemplate>
        </asp:DataList>
    </div>
</asp:Content>

Open in new window

0
Comment
Question by:fishbowlstudios
  • 4
  • 4
8 Comments
 
LVL 9

Expert Comment

by:Roman Gherman
ID: 35135626
Hi,
The problem here is that you are using prototype library and jQuery library together which causes conflicts because of $ sign.

See this link to solve conflicts.

--------------------------
You can find me on: http://extremedev.blogspot.com
0
 

Author Comment

by:fishbowlstudios
ID: 35137346
well I got suppressed the error but nothing happens when I click on the picture.
0
 
LVL 9

Expert Comment

by:Roman Gherman
ID: 35137361
Is there an online version which I can access?

-----------
You can find me on: http://extremedev.blogspot.com
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:fishbowlstudios
ID: 35235259
I'm sorry, I got caught up with a few work projects that kept me away from this project.

No, there is not an online version currently but I can work on that in the next couple of days if you still want to help.
0
 
LVL 9

Expert Comment

by:Roman Gherman
ID: 35238394
Hi,

If it is possible to make an online version which I can access then great.
0
 

Author Comment

by:fishbowlstudios
ID: 35361882
I've uploaded the changes to the website. You may view them at http://www.countrysidequail.com
0
 
LVL 9

Accepted Solution

by:
Roman Gherman earned 500 total points
ID: 35364236
ok, as I was guessing it there is a conflict between lightbox and jquery. check this link:
http://api.jquery.com/jQuery.noConflict/


you may also use other photo gallery libraries like this one: http://leandrovieira.com/projects/jquery/lightbox/

but first try with noConflict.
0
 

Author Closing Comment

by:fishbowlstudios
ID: 35386832
I tried noconflict but I couldn't get it to work right. But I used the other photo gallery and it worked flawlessly. Thanks for you help!
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
insert value of checklistbox checked 4 32
Add a Condition in ASP Repeater 6 33
Need syntax help building hyperlink 2 21
asp.net open new page without popup blocker 8 18
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question