I'm almost finished with my Full Stack Nanodegree final project and while I'm waiting for help on my instructor, I've decided to build my portfolio. However, I'm trying to add a next & previous button inside my jumbotron. It's not working. When I try to add those two buttons, it appears next to my placeholder image instead of the left and right of my container. How can I fix this? More specifically, I'm wondering where to place this snippet of code:
<!-- Next and previous buttons -->
<a class="prev" onclick="plusSlides(-1)">❮</a>
<a class="next" onclick="plusSlides(1)">❯</a>
If you're interested in helping me, here's my GitHub repo: https://github.com/10asmock/portfolio.
I'm also using W3schools' guide on creating a JS slideshow as a reference: https://www.w3schools.com/howto/howto_js_slideshow.asp
Float an element right or left by utilizing Bootstrap 4's float-right and float-left classes.
<div class="float-left">
<!-- left -->
</div>
<div class="float-right">
<!-- right -->
</div>```
More information can be found in the Bootstrap v4 docs
Related
I have a website that i am trying to personalize and I am trying to use the AnimatedModal.js framework. I have been able to display some content in one modal, but when it comes to make several modal it gets tricky, because there is just one ID. My question i, how can i use the same ID and change the content for other modals(demo03,demo04..etc.), in order to personalize each.
I will put some code in order to understand the problem
I have been reading the documentation but I am still stuck in this problem.
<!-- single work -->
<div class="col-md-4 col-sm-6 ads graphics">
<a id="demo02" href="#animatedModal" class="portfolio_item">
<img src="img/portfolio/03.jpg" alt="image" class="img-responsive" />
<div class="portfolio_item_hover">
<div class="portfolio-border clearfix">
<div class="item_info">
<span>Should open here </span> <em> ads / Graphics </em>
</div>
</div>
</div>
</a>
</div>
<!-- end single work -->
Then I have the demo where it displays the content of the modal, where it has the #animatedmodal ID
<div id="animatedModal" class="popup-modal ">
<!--THIS IS IMPORTANT! to close the modal, the class name has to match the name given on the ID -->
<div id="btn-close-modal" class="close-animatedModal close-popup-modal">
<i class="ion-close-round"></i>
</div>
<div class="clearfix"></div>
<div class="modal-content ">
<div class="container">
<div class="portfolio-padding" >
Hello World
</a>
</div>
</div>
</div>
</div>
this is my Js file where there is just one element assigned to it, to avoid showing the same content into all different classes.
$("#demo02").animatedModal();
I don't think it can be done without hacking the plugin.
As a matter of fact, the script jQuery.animatedModal ALWAYS TARGETS the page element which has id="animatedModal"
You can see the plugin source code here:
https://cdn.jsdelivr.net/npm/animatedmodal#1.0.0/animatedModal.js
...
//Defaults
var settings = $.extend({
modalTarget:'animatedModal',
...
Here is the AnimatedModal reference:
https://joaopereirawd.github.io/animatedModal.js/
At the bottom of the page, I can't see any OPTION regarding how to specify a different target, all options are about styles and animation features.
At this point, I think the only way to allow multiple modals on the same page is to rewrite the plugin, but I'm pretty sure you don't want to choose this way.
I am trying to make a responsive sticky navigation bar which will shorten when the screen gets too small (for mobile). The navigation bar works fine without the hamburger bars on my laptop, but i am struggling to implement the following code on W3C with my code.
https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_topnav
the following is a link to jsfiddle with the HTML, CSS and Javascript code I am using.
HTML
https://jsfiddle.net/cpeotvsf/25/
below is my code
<body>
<div class="top-container">
<h1>testing header</h1>
<h3>Scroll down to see learn more.</h3>
</div>
<div class="header" id="myHeader">
<div class="navbar" id="Mynavbar">
Home
<div class="dropdown">
<button class="dropbtn">Services
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
Red or Black Tarmac Drives and Paths
Fencing and Gates
Shingle and Coloured Gravels
Drainage Work
Patios and Crazy Paving
Block Paved Driveways and Paths
Turfing and Artificial Grass
Brick and Purbeck Stone Walls
Decking and Rockeries
</div>
</div>
Gallary
Before and After
Testimonials
Contact Us
<a href="javascript:void(0);" class="icon" onclick="myFunctionn()">
<i class="fa fa-bars"></i>
</a>
</div>
</div>
The CSS and Javascript I am using are in the jsfiddle link above
Any help on this would be greatly appreciated
Your js is fine but jsFiddle keeps the script's load-type on load rather than at the bottom of the page so the onClick can't find the following function:
function myFunctionn() {
// place this script below your body content.
}
To make the above function run properly in jsFiddle, just click JavaScript + No-Library (pure JS) ▼ and change the load type to bottom of body then re-run the script.
jsFiddle with load type updated: https://jsfiddle.net/cpeotvsf/35/
This question already has an answer here:
Is There an Alternative Method to Mimic the Behavior of an Anchor Link/Target Pseudo-Class?
(1 answer)
Closed 5 years ago.
Is it possible to prevent selected anchors from adding to the browser's history?
For a site I am working on now, this is a particular issue when I try to prompt back to a previous page. By doing so the anchors repeat in the order they where activated, and I have to click back more than once before returning back to the previous page.
Here's some code I am currently working with. Is there a function I can implement to achieve this result?
<!-- Image with Anchor to Open Lightbox Window -->
<div class="container">
<a href="#view">
<div class="pic">
<img src="https://URLTOPIC.jpg">
</div>
</a>
</div>
<!-- Lightbox Prompt with Anchor to Close Window -->
<div class="customlightbox lb-animate" id="view">
<div class="customlightbox-imgwrap">
<img class="imgsrc" id="customlightbox-img" src="">
</div>
</div>
<div id="customlightbox-controls" class="lb-animate">
<a id="close-customlightbox" class="lb-animate" href="#!"></a>
</div>
Any help would be much appreciated!
When using a empty anchor, for example <a id="close-customlightbox" class="lb-animate" href="#!"></a> which is used as a button, you can set the href this way that will disable the anchor events <a id="close-customlightbox" class="lb-animate" href="javaScript:void(0);"></a>
You can read more about the javascript URI scheme What does "javascript:void(0)" mean?
For the links you are using to trigger the models, avoid the default behavior for it to be added to the window.history object
document.querySelector('.trigger').addEventLister('click', function(e){
e.preventDefault();
//Do your stuff
});
I am currently having problems with Lightbox2 and TinyCarousel working together!
When i add the lightbox link onto an image within the carousel it shows 2 of that image within the lightbox.
I read a similar situation with bxSlider and the solution was to change the infinite variable to false - i have tried this within tiny carousel but it does not work.
You can see the problem here: http://www.elementintermedia.com/newsite/
Click on the first image in the Slider to start the lightbox and it displays that linked image twice within the lightbox. This is the only lightbox link on the current page also.
I know it's tiny carousel casuing the problem as if i remove that plugin the lightbox works correctly and olny shows the image once
Can anyone please help?? Thanks
Lightbox2 2.7.1 and the bootstrap carousel work well together
for the buttons :
<div class="btn-group">
<a class="btn" href="#scroller" data-slide="prev">previous</a>
<a class="btn" href="#scroller" data-slide="next">next</a>
</div>
And the carousel :
<div id="scroller" class="carousel slide">
<div class="carousel-inner">
<div class="item active">
your content here
</div>
<div class="item">
your content here
</div>
</div>
</div>
I didn't use it exactly like you (1 image per step), but I'm sure you can find a lot of usage examples on the web.
I making page with tabs . And i ahve to make tabs inside tabs which Right now i am making it as button as I am not getting how to make it as tabs. Can anyone suggest me how to make it pls.
Below is my piece of code;
<div id="container">
<!-- Start Tabs !-->
<div class="tab-container">
<div id="c1">
Projects <!-- This is your actual tab and the content is below it !-->
<div class="tab-content"> <!-- tab-container > div > div in the CSS !-->
<button id="create">Create</button>
<button id="edit">Edit</button>
</div>
</div>
just make it with the help of css in short give it backgroud-color or backgroud-image, gradient on button and more and more you can also place div also at the place of button. As you want that's it .... its tutorials also present easily