Hi I have created a basic jquery carousal. I need to make it accessible using tab, so that it follows sequence like Prev tab, casousal dots, next tab.
<div id="mainDiv">
<div id="buttons">
<
>
</div>
<div onclick ="changeContent()" id="sliderDiv">
<ul tabindex="1" class="slider">
<li>
<h3>Image 1</h3>
<img src="images/1.jpg" alt="Image not found">
</li>
<li>
<h3>Image 2</h3>
<img src="images/2.jpg" alt="Image not found">
</li>
<li>
<h3>Image 3</h3>
<img src="images/3.jpg" alt="Image not found">
</li>
<li>
<h3>Image 4</h3>
<img src="images/4.jpg" alt="Image not found">
</li>
<li>
<h3>Iframe</h3>
<iframe src="testIframe.html"></iframe>
</li>
</ul>
</div>
<br>
<br>
<br>
<div class="carousalDots">
<span class="slickdot" onclick ="changeContent()"></span>
<span class="slickdot" onclick ="changeContent()"></span>
<span class="slickdot" onclick ="changeContent()"></span>
<span class="slickdot" onclick ="changeContent()"></span>
<span class="slickdot" onclick ="changeContent()"></span>
</div>
I tried using tabindex property but it didn't work. Any help will be appreciated :)
There are a few issues with your code. First, the only items that are 'tab'-able are the two tags and the which has a tabindex set. If you want the carousel dots to be focusable, you should try to make them into a more appropriate focusable element. something like:
This will allow the dots to be accessed via the tab key, as well as provide the expected hover cursor state.
For your next comment about the sequence being "Prev tab, casousal dots, next tab", I'd suggest reworking your markup to allow for that flow to happen naturally. It's generally bad practice to hijack the focus order away from the user. If you could move the carousel dots into the same div as the prev/next buttons it'd be ideal. This way it's easier for users to navigate to the controls and it's easier to maintain.
Related
Before i start i want to to say many thanks in advance for your help. So, in my case i would like to open ui-sref link inside a bootstrap modal, meaning display the ui-sref in the modal. Below my code:
<ul class="friend-list">
<li class="bounceInDown" style="margin-left:5px;" ng-repeat="conversation in ctrl.conversations" ui-sref-active="active" ui-sref="user-app.inbox.messages({ convID: conversation.id })">
<a class="clearfix" style="cursor: pointer;">
<img ng-src="{{conversation.author.image}}" alt="user and company profil image for messages" class="img-circle" style="margin-right: 15px;"></img>
<div class="friend-name">
<strong>{{conversation.author.name}}</strong>
</div>
</div>
</ul>
This ui-sref link will open the column that contain the messages.
I'm creating a hybrid app for iOS and Android and I'm using framework7 to create it. The thing is I have a media list view that onclick should redirect to a page.html, and it doesn't. I've triple-checked every-name to see if it was a capital letter thing but every name was written correctly. This is the media list view code:
<li>
<a href="Page.html" class="item-link item-content">
<div class="item-media"><img src="abc.png" width="44"></div>
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">Hey!</div>
</div>
<div class="item-subtitle">Hi</div>
</div>
</a>
</li>
Does someone know what might be the problem?
Framework7 uses ajax pages by default, so your target page should be formatted for this, or you can add the class name external to the href tag to open directly.
<li>
<a href="Page.html" class="item-link item-content external">
<div class="item-media"><img src="abc.png" width="44"></div>
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">Hey!</div>
</div>
<div class="item-subtitle">Hi</div>
</div>
</a>
</li>
Check the documentation note: http://framework7.io/docs/pages-ajax.html
Here is my jsfiddle: http://jsfiddle.net/4478bs0L/
I need to place download button underneath of image at left side.
For that, here is my html:
<div><img src="9780143332497.jpg" alt="">
<a href="9780143332497.jpg" class="myButton" download="ss" title="Download">
<img src="/path/to/image" alt="Download">
</a></div>
If i add caption class to the button and set text-align:center; it didn't working.
Can anyone please help me? Thanks in advance.
Option1: Add a <br/> between both images.[Apparently, your button is also an image]. Sometimes the simplest answer is the easiest.
<img src="image1" alt="">
<br/>
<a href="image2" class="myButton" download="ss" title="Download">
<img src="/path/to/image" alt="Download">
</a>
Option 2: enclose your button inside a <div> [ block element]
<div>
<a href="http://s30.postimg.org/b7rdjjkwh/9780143332497.jpg" class="myButton" download="ss" title="Download">
<img src="/path/to/image" style="display:block"alt="Download"/>
</a>
</div>
Option 3: add inline css property display:block to the anchor tag containing your button[inline css would override the myButton class property which is making it appear on the same line]
<a href="http://s30.postimg.org/b7rdjjkwh/9780143332497.jpg" class="myButton" style="display:block;width:60px" download="ss" title="Download">
<img src="/path/to/image" alt="Download">
</a>
Cheers!!
just use a <br> after the image and before the button
<div><img src="9780143332497.jpg" alt="">
<br>
<a href="9780143332497.jpg" class="myButton" download="ss" title="Download">
<img src="/path/to/image" alt="Download">
</a></div>
FIDDLE DEMO
Yes I did it .... implement this code...
<div class="wrap">
<div class="london-olympic">
<h1>Playng To Win</h1>
<span class="span">Author: Saina Nehwal.</span>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_jumbo_share"></div>
<div><img src="http://s30.postimg.org/b7rdjjkwh/9780143332497.jpg" alt="">
<a style="position:absolute; margin-left: -140px; top: 450px;" href="http://s30.postimg.org/b7rdjjkwh/9780143332497.jpg" class="myButton" download="ss" title="Download">
<img src="/path/to/image" alt="Download">
</a>
</div>
<Br><br>
<p>. . . being a player from India defines who I am. When I play, it's for my parents, my coach, and my country.'</p>
<p>Meet Saina Nehwal-India's star badminton player and World Number 4, Padma Shri and Khel Ratna awardee, the girl who brought laurels to India by winning an Olympic medal at the age of twenty-two. In this fascinating memoir, she talks about her childhood and growing-up years; her relationship with the most important people in her life; the ups and downs of her celebrated career, from district level wins to the Olympics; and the sacrifices needed to succeed in any sport. She also reveals little-known facts and offers a peek into her many avatars-daughter, sister, student, and the regular girl behind the badminton prodigy.</p>
<p>Find out what a typical day in Saina's life is like-rigorous training, a strict diet, and no parties or sleepovers. But it's not all work and no play; Saina loves to shop, eat ice cream (post wins only), and play games on her iPad!</p>
<p>With candid photographs and badminton tips from the pro herself, this book showcases the making of a badminton champ-in her own words.</p>
</div>
</div>
Use this code
<div>
<img src="9780143332497.jpg" alt="">
</div>
<div>
<a href="9780143332497.jpg" class="myButton" download="ss" title="Download">
<img src="/path/to/image" alt="Download">
</a>
</div>
I have an instance of CKEditor running to edit small parts of a website. The original HTML is:
<div class="slide slideleft">
<a href="#" class="slidelefta">
<img src="img/left.png" alt="previous" />
</a>
</div>
<div class="slide slidemid noauto" style="height: auto; text-align: center;">
<a href="#" class="sliderighta">
<img src="img/main_item.png" alt="item" />
</a>
</div>
<div class="slide slideright">
<a href="#" class="sliderighta">
<img src="img/right.png" alt="next" />
</a>
</div>
now, when I load it into CKEdit (inside a <textarea>, all correctly encoded with PHP's htmlspecialchars() method), it replaces all my carefully crafted DIVs and styles with the following:
<p><img alt="previous" src="img/left.png" /></p>
<p><img alt="burg.ring1" src="img/main_item.png" /></p>
<p><img alt="next" src="img/right.png" /></p>
which of course totally ruins the page's layout. Can CKEditor somehow be set to not do that?
Thank you!
Since CKEditor 4.1 the Advanced Content Filter feature is enabled. You need to configure it in order to have your HTML passing the validation. See my previous answer here: CKEditor strips inline attributes.
I'm wondering what the best way is to navigate the user to a users profile page when he clicks a <li> item on the members page.
<li>
<img src="images/pic.png" alt="John Smiths's Profile Picture" class="profile-pic">
<div class="name">John Smith</div>
<div class="skills">PHP, ASP, MySQL, SQL Server, Javascript</div>
</li>
That's the sort of markup for each list item, and it comes out at about 640x50 block width/height. I want the user to go to their profile page when they click on any part of the <li> element.
I tried wrapping the entire list item in a link element (<a>), but that just results in a 0x0 sized link element. I'd also prefer not to use Javascript.
Thanks.
You could do this:
HTML:
<li>
<a href="#" title="Link text" class="list-link">
<img src="images/pic.png" alt="John Smiths's Profile Picture" class="profile-pic">
<span class="name">John Smith</span>
<span class="skills">PHP, ASP, MySQL, SQL Server, Javascript</span>
</a>
</li>
css:
.list-link{
display:block;
}
Wrapping A around LI is invalid HTML. Why not just wrap the entire content of the innerHTML of the LI in an A-tag instead?
<li>
<a href="...">
<img src="images/pic.png" alt="John Smiths's Profile Picture" class="profile-pic">
<div class="name">John Smith</div>
<div class="skills">PHP, ASP, MySQL, SQL Server, Javascript</div>
</a>
</li>