Link is not working in dropdown-toggle - hyperlink

Link is not working in dropdown-toggle button in nav bar (Header menu), when i click dropdown list is working but the link is not working. The link is "Product.html" but its not go to the product page.
Product<span class="fa fa-angle-down dropdown-arrow"></span></span>

Try to remove the extra closing </span> tag inside the <a></a> tag.
Product<span class="fa fa-angle-down dropdown-arrow"></span>

Related

Anchor tag in AMP page reloads entire page

I have the following hyperlink on an AMP page, it's a link to an anchor further down on the page:
party
The anchor tag is present too:
<a name="party"></a>
Now when the user is on URL https://www.example.com/venues/amp and clicks the hyperlink, the entire page reloads and shows https://www.example.com/venues/amp#party
I don't want the page to reload, I just want to jump to the anchor tag like in a regular web page, so why is this happening? Testing Chrome on Windows 10.
Change the following
party
to
<span role="button" tabindex="0" on="tap:customId.scrollTo(duration=500, position=top)"> Go to Target </span>
and
<a name="party"></a>
to
<span id="customId"></span>
Click here for example
For more information Click Here

iOS-like tab with Ionic Framework

I was using ionic for a project but been not much satisfied with the UX for iOS. I mean how can I add this tabs (see picture) instead of the basic tab ionic comes with when you create a tab project ?
enter image description here
You can use the <ion-nav-buttons class="button-bar"></ion-nav-buttons> directive to add buttons for every tab mentioned in your screenshot.
<ion-nav-buttons class="button-bar" side="left">
<a class="button"
ui-sref-active-eq="active"
ui-sref="path1">
Label 1
</a>
<a class="button"
ui-sref-active-eq="active"
ui-sref="path2">
Label 2
</a>
<a class="button"
ui-sref-active-eq="active"
ui-sref="path3">
Label 3
</a>
</ion-nav-buttons>
The ui-sref along with ui-sref-active directive makes sure that the tab with the active state is in focus

TWBS Navbar on mobile device, disable dropdown menu and use link instead

Is there a way to disable the dropdown menu in Twitter Bootstrap 3 navbar when viewing on an iPhone and similar device sizes and then to replace it with a link to another screen.
The menu takes up a lot of space. On a desktop (even a tablet) this doesn't matter. On a mobile phone I would like it to take you to a different page and disable the dropdown altogether.
CSS Approach
I would use the responsive classes for this. It's probably not ideal to have extra markup for hidden elements, but it is the easiest and most reliable approach and requires no Javascript.
demo
...
<li class="visible-xs-block"><span class="glyphicon glyphicon-user" aria-label="My profile"></span> My Profile</li>
<li class="dropdown hidden-xs">
<span class="glyphicon glyphicon-user"></span> My Profile <span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li><span class="glyphicon glyphicon-signal"></span> Statistics</li>
<li><span class="glyphicon glyphicon-certificate"></span> Certificates</li>
<li><span class="glyphicon glyphicon-star"></span> Favorites</li>
<li class="divider"></li>
<li><span class="glyphicon glyphicon-log-out"></span> Logout</li>
</ul>
</li>
...
In the above snippet, you'll see that I'm using the visible-xs-block class on the <li> with the link to your alternative page. This will insure that that this element is hidden, except on mobile devices. On the dropdown, I've used the hidden-xs class, which will hide the dropdown only on mobile devices.
Javascript Approach
You can do this with Javascript as suggested by #cvrebert, and if you don't have to worry about support for IE8 or IE9, you can do this easily with matchMedia.
JS (no support for IE8/9)
if (window.matchMedia("(max-width: 768px)").matches) {
/* the view port is less than 768 pixels wide */
/* hide your dropdown and display your link */
} else {
/* the view port is at least 768 pixels wide */
/* show your dropdown and hide your link */
}
It's a bit more complicated if you want a Javascript solution and need to support IE8/IE9 because you'll have to monitor the window resize event. To do this efficiently, you'll probably want to debounce or use a timeout.
Again, to me, the best way is the CSS approach above.

how to open <href> in another tab on clicking the link first

Need to refresh currently opened tab on each click on an image with out opening the image url again and again on new tabs.
Try out this
<img src="IMAGE URL">
example
<a href="file:///D:\images.jpg" target="_blank">
<img src="file:///D:\images.jpg"/>
</a>
Try out this
Example
<img src="image.jpg" alt="image" width="20px" height="35px">

Jquery Mobile using fastklick but Back button very slow

I am using the fastklick plugin for iOS what is very popular on the net for speeding the click event on jquery mobile apps with phonegap on iOS.
The buttons and links are working very well except the back button from jquery.
If I use this:
<div data-role="page" id="test" data-add-back-btn="true">
then if I want to click on the button, there is already the delay from iOS. The button is getting blue at first and after that the page is sliding. How can I prevent this so this button is working fast like the other buttons I am creating with
<button>...</button>?
Is it possible to create my own back button and apply an event to it?
First remove data-add-back-btn="true" then you can try this:
<a class="ui-btn-left" data-icon="arrow-l" href="javascript:history.back(1) " data-theme="a">Back</a>
or this:
<a class="ui-btn-left" data-icon="arrow-l" href="#" data-theme="a" id="back-btn">Back</a>
$('#back-btn').bind('touchstart', function(e) {
$.mobile.changePage("#pageID");
});
Just change #pageID to your real page ID. touchstart event is great for back button if you are just doing it and not a page scrolling.

Resources