Having trouble with prettyphoto functionality

Seeking assistance as I am struggling to get this working

Here is how I have set it up:

<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen"/>
<script src="js/jquery.prettyPhoto.js" type="text/javascript"></script>

For displaying photos, I use the following code:

rel="prettyPhoto[pp_gal]"><

And right before the closing body tag, I include this script:

<script type="text/javascript" charset="utf-8">
    $(document).ready(function(){
        $("a[rel^='prettyPhoto']").prettyPhoto({
            animationSpeed: 'normal',
            padding: 40,
            opacity: 0.35,
            showTitle: true,
            allowresize: true,
            counter_separator_label: '/',
            theme: 'light_rounded'
        });
    });
</script>

I have successfully linked the prettphoto CSS file in my document. However, I'm unsure about what to do with the jquery.js and the jquery-1.3.2.min.js folders. Any guidance would be appreciated.

Answer №1

  1. Ensure the js and css folders are located appropriately in relation to your current page. For instance, if you are editing http://localhost/photogallery/index.html, make sure the 3 folders that come with your prettyPhoto download are extracted to http://localhost/photogallery/, not at the root of your server.
  2. Confirm that you have the necessary "images" folder for prettyPhoto. This contains various themes and resources essential for the proper appearance of prettyPhoto.
  3. A conflicting library or jQuery version might be preventing prettyPhoto from loading. Try testing prettyPhoto on a blank page with only the required scripts and CSS included, along with a couple of image links containing rel="prettyPhoto[pp_gal]". If it works in this setup but not when integrated back into your main page, then there may be a conflict between prettyPhoto and jQuery on the page.
  4. Check for any errors on the page. Different browsers offer tools like Internet Explorer's Developer Tools, Firefox's Firebug, and Chrome's Developer Tools. Look up how to use the tools specific to your browser for more information.

Answer №2

As mentioned in Dawson's fourth response, it is important to verify that there are no javascript errors on your website causing prettyPhoto to malfunction.

I spent two hours frustrated as I couldn't get it to work. Eventually, I checked Firefox's Tools > Web Developer > Error Console and found an error caused by a different JavaScript code from another widget. Once I commented out that line, everything started working smoothly.

Never underestimate the importance of checking for any issues multiple times.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

display child element at full width within a parent element that is not full width

I have a container with a maximum width of 1024px, and I want one of its child elements to take up 100% width starting from the left edge of the screen. Is there a way to achieve this without adding extra HTML markup? I know I can make the child element 1 ...

What is the reason behind the CSS not rendering when async:false is used?

I find it peculiar and am actively seeking an explanation for this anomaly. In my code snippet, the AJAX call seems to be causing unexpected behavior: $('.edit-config').click(function() { var that = this; var msg; ip ...

Storing query for later utilization using form and javascript

I have implemented a function to create charts using the following code snippet: $('#button_submit').click(function() { var start_date = $('#start_date').val(); var end_date = $('#end_date').val(); var type = $( ...

I'm currently facing difficulties trying to implement AJAX with JavaScript and PHP as the desired output is not being

My query is quite straightforward - why isn't the code functioning properly? I am attempting to have the text echoed in PHP displayed inside a div with the ID of "show". Interestingly, this works with a txt file but not with PHP or any other type of f ...

The error message "Cannot read property 'properties' of undefined" is being thrown by the leaflet-search plugin

I attempted to implement the leaflet-search feature using a Vue-cli component. However, when I initiate a search, I encounter the following error message specifically related to the leaflet search function: Uncaught TypeError: Cannot read property &apo ...

Jquery fails to function properly unless the page is refreshed

On my MVC page, I have implemented a feature where certain text-boxes are shown or hidden based on the value selected in a drop-down menu using jQuery. The functionality works fine when the page is isolated, but when placed under a menu, it encounters a pr ...

Fade-In and Fade-Out CSS Effect with Background Images Displaying a Blank Last Image

I've been experimenting with applying a CSS-only background image transition to a div, but I encountered an issue where after cycling through three specified images, the background reverts back to the original black color. Even stranger, when I adjust ...

Displayed data from jQuery ajax reveals [object Object]

My AJAX call is quite simple, it alerts the data that the server has returned. $.ajax({ type: "POST", url: "/someform/act", //changed from utl to url data: { changed: JSON.stringify(plainData) }, //updated to include success: f ...

Transformation of a double-row header

Click here to view the design - two-row header image I'm struggling with creating a header design that consists of two rows - the first row includes a centered logo and icons on the right side, while the second row contains the menu. Can someone guid ...

Node.js and Express: Delegate routes to different endpoints for handling by the Single Page Application, instead of just the root route

I have my node.js/Express server configured to host my Vue.js single page application from the root URL path (localhost:3333) within the public folder. When navigating through my app, everything works smoothly thanks to the vue.js History API handling all ...

Experiencing a bug in the production build of my application involving Webpack, React, postCSS, and potentially other JavaScript code not injecting correctly

I've encountered an issue with my webpack.prod.config when building my assets, which may also be related to the JS Babel configuration. While I can successfully get it to work in the development build by inline CSS, the problem arises when attempting ...

The <img> tag needs to dynamically adjust its size based on the width of its parent element, while ensuring it does not exceed its original dimensions

I spent hours working on my tribute page project on codepen and managed to pass 9 test cases. However, no matter what I try, I just can't seem to pass the last test case. My CSS code: #img-div { display: block; filter: grayscale(100%); width: 1 ...

What is the reason that setState functions properly when parsing each key separately, but fails when passed as an object?

Currently, I am delving into the world of React and TypeScript, but I have encountered a problem when trying to pass an object with a specific type in order to update the state. For some reason, the state remains unchanged. My approach involves using the ...

React-Image-Annotate encountered an issue: SyntaxError - The import statement cannot be used outside a module

Encountering an issue while trying to set up react-image-annotate. Here is the problem I am facing initially: https://i.stack.imgur.com/XgYPd.png This is how I have implemented it: import React from 'react' import ReactImageAnnotate from ' ...

Interested in transferring an additional column value to the $scope.seriesSelected variable?

I've been delving into Timeline charts using the angularjs google chart API and have come across an interesting limitation. It seems that only 4 columns are allowed, with the extra column designated for tooltips. However, I have a specific requirement ...

Experimenting with animating an element through onClick event using JavaScript

I would like to create an animated div using JavaScript that activates on click. <div class="Designs"> <p>Designs</p> <div class="Thumbnails" data-animation="animated pulse"> <a href=" ...

Achieving a shuffling CSS animation in Angular 8 may require some adjustments compared to Angular 2. Here's how you can make it

Seeking assistance with animating an app-transition-group component in Angular 8. My CSS includes: .flip-list-move { transition: transform 1s; } Despite calling the shuffle function, the animation always happens instantly and fails to animate properly ...

Accessing the background page of a Chrome extension while it's in operation

I am in the process of developing my first chrome extension that allows youtube.com/tv to run in the background so it can be accessed easily on a phone or tablet. Everything is working fine, except for the fact that if I want to watch the video and not j ...

Ensure the webpage is set to have a minimum width of 1024 pixels

Is it possible to make a webpage that utilizes bootstrap, Angular 2x, and Scss stop being responsive once the screen width reaches 1024px? I would like the layout to stay fixed at this size and enable horizontal scrolling for users who resize their browser ...

Utilizing Wordpress post images to dynamically change background URLs in CSS

Is there a way to dynamically set a background image in CSS using PHP, specifically the Wordpress post image? background: <?php if(has_post_thumbnail()){ $img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'dest ...