I have to manage a website witch have the following situation:
We have a banner system on the website, but the banners are clickable only on small area. I want to make them all clickable, but there are some limitations.
I don`t have access to php files and I can manage HTML after certain level.
Currently I can manage only small area which is marked on the image.
Example of the area
Every code that I write is placed only in this marked area. There is no way to make whole banner clickable, because there is no that kind of option on GUI.
I think that I can target with CSS classes that are above that area, but can`t edit the HTML.
Is there an option to make all this area clickable without messing everything up?
Here is the full HTML code of one banner:
<li class="flex-active-slide" style="width: 1583px; float: left; display: block;">
<div class="image-flexslider-content-left clearfix">
<div class="views-field views-field-field-slider-image">
<div class="field-content"><img typeof="foaf:Image" src="/example-image.png" alt="" draggable="false" style="margin-left: -84.25px; height: 510px;"></div>
</div>
</div>
<div class="white">
<div class="logo-big mobile-logo">
<h1 class="logo">
</h1>
</div>
</div>
<div class="wrapper-container white">
<div class="logo-big">
<h1 class="logo">
</h1>
</div>
<div class="slide-cover flexslider-content-left">
<div class="views-field views-field-title"> <span class="field-content"></span> </div>
<div class="views-field views-field-body">
<div class="field-content">
<a href="/something/more/">
<div class="double-container">
<p class="double-blue-head larger-head" style="font-size: 2.4rem !important; font-weight: bold;">Line of text 1</p>
</div>
<div class="double-container">
<p class="double-blue-head larger-head" style="font-size: 2.4rem !important; font-weight: bold;">Line of text 2</p>
</div>
</a>
<div class="double-container blue-responsive double-blue-head larger-head myt-margin" style="padding: 10px 12px 15px 20px; margin-top: 40px;">
<img src="/images/example.png" style="width:100% !Important; max-width:435px !Important; margin-top: 10px; height:auto !important;" draggable="false">
</div>
</div>
</div>
<div class="views-field views-field-contextual-links"> <span class="field-content"></span> </div>
</div>
</div>
</li>
You could move the tag outside of the entire div class="field-content"
<a href="/something/more/">
<div class="field-content">
<div class="double-container">
<p class="double-blue-head larger-head" style="font-size: 2.4rem !important; font-weight: bold;">Line of text 1</p>
</div>
<div class="double-container">
<p class="double-blue-head larger-head" style="font-size: 2.4rem !important; font-weight: bold;">Line of text 2</p>
</div>
<div class="double-container blue-responsive double-blue-head larger-head myt-margin" style="padding: 10px 12px 15px 20px; margin-top: 40px;">
<img src="/images/example.png" style="width:100% !Important; max-width:435px !Important; margin-top: 10px; height:auto !important;" draggable="false">
</div>
</div>
</a>
With JavaScript, you can add an event handler to make any element on the page clickable. So for example, if you want to make one of the <div class="field-content"> elements clickable, you would add an event handler like this (assuming you want to make the first one clickable for this example):
document.querySelectorAll("div.field-content")[0].addEventListener('click', function() {
// your code here; whatever you want to happen when they click
});
You can apply event handlers to any of the HTML elements on your page. If you apply it to a parent element, then it will also be triggered when a child element is clicked, so you can make your whole banner clickable just by adding an event handler to the banner's outer element.
UPDATE: To apply the click handler to an entire class, use a for loop, like this:
var banners = document.getElementsByClassName("field-content");
for (var i = 0; i < banners.length; i++) {
banners[i].addEventListener('click', function() {
location.href = "yourURL";
});
}
Related
I want to fetch the text inside last div. I have tried something below as well
$html = $crawler1->filter('span[id="verisysForm:cnicStatusPanel"]')->text(); // returns empty
Here is the structure from where i want to get text.
<span id="verisysForm:cnicStatusPanel">
<span style="border: none;background-color: #FFFDFA;">
<div class="row">
<div class="col-md-12" style="padding-top: 30px">
<div style="text-align: left; border-radius: 10px;background-color: #E9F5DE;background-color: #d9edf7;padding-top:19px;">
<div style="text-align: left;padding-left: 10px;font-size: 18px;font-family: calibri; color: black;padding-bottom:10px;">
The Card: 123456789 and issue date: 1999/10/08 is currently INACTIVE. However, another card has been issued in lieu of this card.
</div>
</div>
</div>
</div>
</span>
</span>
Hi I want to align two rows of div under each other no matter the height of the divs in the row above. I'm using display:inline-block; so that the divs will inline next to each other.
Here is what I'm getting
Photo 1
Notice that div #2 is slightly shorter than div one
and here is what i want to accomplish
enter image description here
Notice that in the second picture no matter the height of the div above it the second row still aligns as it should.
here is my css
.post-set{
max-width:445px;
margin:0px 1px 15px 0px;
padding:0;
display:inline-block;
border-bottom:1px solid #e1e1e1;
vertical-align:top;
}
i'm using this in my wordpress theme. Here is the html along with the php.
<div class="medium-8 column post-set" style="padding:0;">
<a href="<?php the_permalink(); ?>" title="<?php printf(__( 'Read %s', 'wpbx' ), wp_specialchars(get_the_title(), 1)) ?>">
<?php the_post_thumbnail('fifth-post'); ?>
</a>
<div class="row column" style="padding:0">
<h1 class="fifth-post-title"><?php the_title(); ?><h1>
<div class="fifth-ex">
<?php echo excerpt(18); ?>
</div>
<span class="fifth-by-line"> BY: <?php the_author_posts_link(); ?></span>
</div>
</div>
You can visit GetVersed.us to see a live example. It's the section under the "Get Your Voice Heard Banner"
is there a way to accomplish this without suggesting masonry?
I don't see HTML you are using. But here is solution with my html code and yours CSS class. Notice that in CSS I set width instead of max-width.
Different height of div blocks I set using inline style. It can be set in class or auto.
.post-set{
width:60px;
margin:0px 1px 15px 0px;
padding:0;
display:inline-block;
border-bottom:1px solid #e1e1e1;
vertical-align:top;
background-color:black;
}
<div>
<div class="post-set" style="height:20px;">
</div>
<div class="post-set" style="height:35px;">
</div>
</div>
<div>
<div class="post-set" style="height:15px;">
</div>
<div class="post-set" style="height:30px;">
</div>
</div>
You can create a simple table and place your divs as follows:
<table>
<tbody>
<tr>
<td>
<div 1...>
</td>
<td>
<div 2...>
</td>
</tr>
<tr>
<td>
<div 3...>
</td>
<td>
<div 4...>
</td>
</tr>
</tbody>
</table>
This will make sure that the alignment is as you wish. You can then add some styles if you wish.
You should look into flexbox.
HTML:
<div class="item_container">
<div class="item">
</div>
<div class="item">
</div>
</div>
<div class="item_container">
<div class="item">
</div>
<div class="item">
</div>
</div>
CSS:
.item_container {
display:flex; align-items:stretch;
}
.item { float:left; }
<div class="col-lg-4 col-sm-6">
<a href="#" class="portfolio-box">
<img src="img/portfolio/1.jpg" class="img-responsive" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category:-
</div>
<div class="project-name">
Mobile
</div>
</div>
</div>
</a>
</div>
//1.jpg image is appearing in the view i want to switch to another view after clicking on this image.
You can achieve this with css:
#my-div{
background-color: #000;
width: 200px;
height: 200px }
a.fill-div {
display: block;
height: 100%;
width: 100%;
text-decoration: none}
<div class="col-lg-4 col-sm-6" id="my-div">
the rest of it.
</div>
So I am working to make a change on this site. http://www.kbduct.com . One the site there is a png file of a transparent united states logo on the front. I had to add a small awfs logo banner to it and have the viewer be able to click on it so that it can lead to a different site. I added the anchor tags to these items but nothing happens wen you click on it. Heres the index file and the external file for the image.
BTW, I didn't build this site. Im helping to maintain it for the time being.
INDEX:
<?php include('inc/default.php');
$pageTitle = "The Nations Source For Industrial Ducting, Ducts and Ductwork Components - KB Duct";
$pageDisc = "KB Duct is the Nation's source for industrial duct, ducting components and ductwork fittings and supplies. We offer custom built solutions for your industrial needs.";
$pageKeys = "duct, ductwork, ducting, duct work, commercial ducting, industrial ducting, custom ductwork, ductwork supplies, ducting accessories, duct fittings";
?>
<!doctype html>
<html>
<?php include('inc/head.php'); ?>
<body>
<div id="sb-site">
<?php include('inc/maximage.php'); ?>
<?php include('inc/header.php'); ?>
<div class="mainarea">
<a href="http://awfsfair.org/">
<div id="eBanner" style=" position: absolute; right: 380px; top: 310px;">
<?php /*?> <script type='text/javascript' src='http://libs.a2zinc.net/Common/JS/10.6.0.0/a2zWidget.js'></script><script type='text/javascript' id='exWidget'>new a2z.Widget('dGbJ%2fQfPqUA4s%2fDNrIc%2fzt5xiq%2fL4ZoFjVXmdUEcJutOcD9ggxZSCZyU8MZ6cQu6',40297,'http://libs.a2zinc.net/Common/Widgets/ExhibitorBadge.aspx',31,201133,330,200).render();</script>
<?php */?>
</a>
</div>
<div class="wrapper">
<?php include('inc/industry.php'); ?>
<?php include('inc/catatypes.php'); ?>
<div id="mob-only">
<?php include('inc/mobslideup.php'); ?>
</div>
</div>
</div>
<?php include('inc/footer.php'); ?>
</div>
<?php include('inc/mob-menu.php'); ?>
</body>
</html>
MAXIMAGE.PHP:
<div id="maximage">
<div>
<img src="img/Custom-Ductwork-Clamp-Together-Ducting-Shiny-Ducts-BG.jpg" alt="KB Duct is the nation's source for clamp together and flanged industrial ducting and duct parts." />
<div class="in-slide-content" style="display:none;">
<img src="img/nations-source-for-industrial-ducting.png" alt="KB Duct offers custom fabricated industrial ducting solutions.">
</div>
</div>
<div>
<img src="img/shinyduct.jpg" alt="" />
<div class="in-slide-content" style="display:none;">
<img src="img/awfs-nations-source.png">
</div>
</div>
<!-- <div>
<img src="img/kbduct-production.jpg" alt="" />
<div class="in-slide-content" style="display:none;">
<img src="img/nations-source-for-industrial-ducting.png">
</div>
</div>-->
<div>
<img src="img/plasma.jpg" alt="" />
<div class="in-slide-content" style="display:none;">
<img src="img/awfs-nations-source.png">
</div>
</div>
<div>
<img src="img/welding.jpg" alt="" />
<div class="in-slide-content" style="display:none;">
<img src="img/awfs-nations-source.png">
</div>
</div>
<!-- <div>
<img src="img/clamp.jpg" alt="" />
<div class="in-slide-content" style="display:none;">
<img src="img/nations-source-for-industrial-ducting.png">
</div>
</div>-->
<div>
<img src="img/tunnel.jpg" alt="" />
<div class="in-slide-content" style="display:none;">
<img src="img/awfs-nations-source.png">
</div>
</div>
MAXIMAGE CSS ID:
#maximage {
display:block;/* Only use this if you fade it in again after the images load */
position:fixed !important;
z-index:-1;
CSS IN SLIDE CONTENT:
.in-slide-content {
color:#333;
float:right;
font-family:'Helvetica Neue', helvetica;
font-size:60px;
font-weight:bold;
right:20px;
margin:40px;
padding:20px;
position:absolute;
top:20px;
width:700px;
z-index:9999; /* Show above .gradient */
text-shadow: 0 1px 0 #fff;
-webkit-font-smoothing:antialiased;
}
I did some R&D got some thing. May be this help you
There is a id eBanner change inline styling to
position: absolute;
right: 269px;
top: 141px;
z-index: 9999;
height: 100px;
width: 185px;
border: 2px solid red;
Inside this div there is and anchor tag add folloing style
display: block;
width: 181px;
height: 100px;
Once you check it works then you can remove red border
I am trying to find and change a string found before an other string.
<div class="item" ....>
<img scr="rambo" />
This code repeats for every movie. I have to set the item class for any chosen movie to
<div class="item active" ....>
<img scr="rambo" />
So I am looking for the first class before any given movietitle and then set it to active.
(In the code, where i placed the dots, there is a lot of code that keeps changing (like coordinates) so I can't count backwards to that position.)
Can someone help me with this? Thnx.
This is the actual code for 2 movies wich is created by a javascript coverflow script:
<div class="item " href="cover.php?film=Terminator 2" style="display: block; left: 452.383126009628px; top: 176.25px; height: 264.375px; width: 117.666903409091px; font-size: 50%; z-index: 32765; visibility: visible;">
<canvas class="content portray" src="films/Terminator 2/cover.jpg" origproportion="0.6676136363636364" width="235" height="528"></canvas>
<div class="caption">Terminator 2 Judgment Day
<div class="cover_beschrijving">
<div class="cover_left">
<ul>
<li><h1>jaar:</h1>1991</li>
<li><h1>genre:</h1>Actie</li>
<li><h1>speelduur:</h1>137 minuten</li>
</ul>
</div>
<div class="clearer"></div>
<div class="cover_right">--Movie discription--</div>
</div>
</div>
</div>
<div class="item active" href="cover.php?film=The Fast and the Furious" style="display: block; left: 727.832386363636px; top: 0px; height: 528.75px; width: 236.335227272727px; font-size: 100%; z-index: 32768; visibility: visible;">
<canvas class="content portray" src="films/The Fast and the Furious/cover.jpg" origproportion="0.6704545454545454" width="236" height="528"></canvas>
<div class="caption">The Fast and the Furious
<div class="cover_beschrijving">
<div class="cover_left">
<ul>
<li><h1>jaar:</h1>2001</li>
<li><h1>genre:</h1>Actie</li>
<li><h1>speelduur:</h1>107 minuten</li>
</ul>
</div>
<div class="clearer"></div>
<div class="cover_right">---Movie discription---</div>
</div>
</div>
</div>
You can use preg_replace to find the strings and replace them. This regex <div\sclass=\"item\".*> will match <div class="item" ....> If you want to include the img tag in the match, you have to modify the regex accordingly, but I don't see why you care for that, if it was me I would stop at <div class="item"
Then it's just a matter of providing the replacement string.