The CSS code is causing the jQuery cycle plugin to malfunction

I have successfully integrated the cycle plugin for jQuery to create a dynamic rotating slideshow with tabbed navigation and links derived from image alt tags.

While each element functions properly on its own, they appear to clash when combined. After some investigation, I suspect an issue within the CSS as disabling it resolves the problem. However, pinpointing the exact CSS culprit has proven challenging.

Is there something obvious that I might be overlooking?

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title>jquery fade</title>
 <link rel="stylesheet" type="text/css" media="screen" href="jquery2.css" />
 <script type="text/javascript" src="js/jquery-1.3.js"></script>
 <script type="text/javascript" src="js/jquery.cycle.all.js"></script>
 <script type="text/javascript">

function onAfter() {
        var link=null;
        if($(this).attr("alt") == 'link1'){link="link1"}
        else if ($(this).attr("alt") == 'link2') {link="link2"}
        else if ($(this).attr("alt") == 'link3') {link="link3"}
        else {link="link4"};

    $('#text').html('<p><a href="' + link + '" target="_blank">' + this.alt + '</a></p>')};

$(document).ready(function(){
    $('#myslides')
        .before('<div id="nav">')
    .cycle({
        fx: 'fade',
        speed: 500,
        timeout: 3000,
        after: onAfter,
    pager:  '#nav'
    })      ;
});
</script>

</head>
<body>
    <div id="content-area">
    <div id="myslides">
     <img src="image1" alt="alt1" title="title1"/>
     <img src="image2" alt="alt2" title="title2"/>
     <img src="image3" alt="alt3" title="title3"/></a>
     <img src="image4" alt="al4" title="title4"/></a>
    </div>

        <div id="text">
        </div>
</div>
</body>
</html>

CSS: @charset "utf-8"; /* CSS Document */

body {
    background: rgb(230,230,230);
}

#content-area{
    width: 586px;
    height: 311px;
}

#myslides {
    width: 586px;
    height: 311px;
    padding: 0;
    margin:  0 auto;
    z-index: 0;
} 

#myslides img {
    width: 586px;
    height: 311px;
    top:  0;
    left: 0;
    border : 0;
}

#text  {
    height: 34px;
    width: 586px;
    background-image:url(images/text-transperancy.png);
    position: absolute;
    top: 285px;
    z-index:50;
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    color:#FFF;
}

#text p {
    margin-left: 10px;
    line-height: 10px;
    }

#text a { 
    outline: none;
    border : 0;
    text-decoration: none;
    color:#FFF;
    }

#text a.visited { 
    color:#FFF;
    }
#text a:focus {
    outline: none;
    border : 0;
    color:#FFF;
    text-decoration: none  
}

#text a:link { 
    font-family:Arial, Helvetica, sans-serif;
    color:#FFF;
    border : 0;
    text-decoration: none;
}

#nav  {
    padding-left: 465px;
    position: absolute;
    top: 295px;
    z-index: 100;
}

#nav a { 
    margin: 0 5px;
    padding: 3px 5px;
    border: 1px solid #fff;
    background: #0079c2;
    text-decoration: none;
    z-index: 100;
    }

#nav a.activeSlide { 
    background: #6eb43f;
    z-index: 100;
    }
#nav a:focus {
    outline: none;
    z-index: 100;
    }

#nav a:link { 
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    color:#FFF;
    z-index: 100;
}

Answer №1

Disregard the previous concern, I have identified the problem - it appears that the #nav div was obscuring the content of the #text div.

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

Eliminate lower values in select 1 if the value selected in select 2 is higher

I am struggling with a particular piece of code and could really use some assistance. Within my project, I have two select boxes. The first box allows users to select the "from" year, while the second box is for selecting the "to" year. What I'm tryi ...

How can I utilize a JSON object in Scala to establish a database connection through JavaScript?

Recently diving into Scala and Play, I am currently learning how to work with a JSON object. I need to send this JSON object to my Scala controller class and then connect it to the database for storage. However, I'm not quite sure how to go about doin ...

Step by step guide on incorporating two background images in a single header

I'm looking to create a header with a background image that appears twice, like this: To achieve the effect, I added opacity of 0.5 to one of the images, but it is affecting everything in my header including text and logo. Is there a way to prevent t ...

Unspecified variable in AngularJS data binding with Onsen UI

I am new to Onsen UI and AngularJS, and I have a simple question about data binding. When I use the variable $scope.name with ng-model in an Onsen UI template, it returns as UNDEFINED. Here is my code: <!doctype html> <html lang="en" ng-app="simp ...

What is the best way to display the complete text or wrap a menu item in an Angular Material menu?

Is it possible to display the full text of a menu item instead of automatically converting it to ellipses or breaking the word? I've tried various CSS methods without success. Any suggestions? https://i.stack.imgur.com/3l7gE.png #html code <mat-m ...

Generating a Grid List featuring Direct Links

Struggling to create a grid layout with images, titles, and descriptions that are all clickable links? The challenge is in making the entire list item act as a link, rather than just specific elements within it. Take a look at the demo below, where clickin ...

The data input from the HTML is not being correctly transferred to the modal

I am trying to transfer the reservation id from an HTML element to a modal window. When I click "cancel" next to a reservation, a modal should appear showing the reservation id. However, the modal pops up without displaying the reservation id. Can anyone h ...

Which SSO framework works best for integrating Facebook and Twitter logins?

I own a website and I'm looking for a way to let users leave reviews and rate products. I need an SSO system that allows them to sign in with their Facebook or Twitter accounts and ensures each user is uniquely identified so they can't rate produ ...

Utilizing deeplinks within the FlexSlider plugin

Is there a way to implement deeplinking on flexslider similar to royal slider? By deeplinking, I mean that when a thumbnail is clicked, the URL in the browser should change as if it's pointing to a specific slide in the slider... Thank you in advanc ...

The information overflow occurs outside the tooltip specifically in Chrome, while functioning perfectly in IE11

As a newcomer to the CSS world, I am experimenting with adding a block-level element (div) inside an anchor tag's :hover pseudo-class popup. The div element contains a table that needs to have dynamic sizing for both the table itself and its cells (wi ...

The impact of CSS padding on the dimensions of a component

Is there a way to maintain the fixed width and height of a button or label even after adding padding? I attempted to use box-sizing:content-box, but it didn't work as expected. View the example code here Thank you in advance. ...

Changing an HTML5 attribute with the power of jQuery and ajax

I'm working on a rails view where I have a div that displays a collection of users: <div id="users" data-current_page="<%<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="635e2316100611104d00161111060d7">[email  ...

Using ajax requests to target numerous div elements

I am working with two pages in jQuery Mobile. Each page contains a div called content, where I load external pages using AJAX. Interestingly, the call works perfectly for "page1", but it doesn't seem to be working for "page2", even though both pages h ...

When clicking, the current Accordion panel will close automatically to ensure only one panel is open at a time

Click here to view the accordion The accordion functions smoothly, however, I am unable to close all panels simultaneously. It seems like there might be a missing line or two in the code. jQuery $(document).ready(function() { // Defining variables var a ...

Fuzzy Background to Enhance Your Bootstrap 5 Offcanvas Navigation Menu

Currently utilizing Bootstrap v5.2, I am endeavoring to replicate the image displayed in the link below: Blurry Sidebar Backdrop As per the MDN Documentation, backdrop-filter is intended for blurring the background of an element. .offcanvas-backdrop { ...

Modifying the CSS color value does not result in a change to the background color

Currently implementing this Jekyll theme, and I am interested in adjusting the vibrant yellow hue to a different color option (such as gray). Despite altering the CSS color value, it seems that the background color persists unchanged. https://github.com/ ...

Using recursion in JavaScript to construct HTML elements with multiple children all contained within a singular parent element

I'm currently working with a json object that I need to loop over in order to build html blocks for each object. While I've managed to get this working smoothly, I am facing a challenge with the child items not being contained within their own pa ...

How to style an unordered list to appear horizontally on Internet Explorer versions 6 and 7 using CSS

After creating a template for WebSVN, I put in the effort to ensure it adheres to web standards and validates. Most browsers display it well, but unfortunately IE 6 and IE 7 fail to render the unordered list horizontally. This causes each <li> elemen ...

PHP conditionals

Viewing the webpage www.evolvedtools.org/Genr8PageIntro.php, I have implemented a method to fetch blogs from my wordpress.org blog and display them on this particular page using some simple php markup: In the header of the page: <?php require('. ...

What is the best way to implement a dropdown menu with JavaScript or jQuery?

I'm looking to create a dynamic dropdown list using Javascript or JQuery that mirrors the functionality of selecting countries, states, and cities. Can someone provide guidance on the best code to achieve this? Below is a snippet of my existing code: ...