ASP.NET/Javascript hyperlink popup menu upon left click - javascript

I need to display a mobile-phone compatible popup menu when user left-clicks a HyperLink control. A menu will contain various options for this link, so its handler had to be aware of the clicked link data (actually, each link corresponds to a nickname).
What do I need to make that work?:)

Here are some links with pop menou.
http://www.php-development.ru/javascripts/dropdown.php
http://www.dynamicdrive.com/dynamicindex1/index.html
http://www.1stwebdesigner.com/resources/38-jquery-and-css-drop-down-multi-level-menu-solutions/
I think that there are too many more to find on google.

Related

Bootstrap Modal - toggling modal with an anchor with a valid external HREF (for backup)

The reason for this to cover any user that MAY have javascript turned off. It's a company standard that we develop our web pages for this, since our demographic still have their VCR's blinking 12:00.
I have a text link that is being populated by a database call:
Click for Article
The common user experience is that the user will click the link, and it will toggle a modal displaying the article. BUT we want to incorporate a fallback in case the user has javascript turned off, so when the link is clicked, it will simply take the user to the article page and display the dynamic content loaded by padding the Article ID of 123.
Currently with Bootstrap properly loaded on the page, when the user clickson the link, it just goes to the article page and does NOT toggle the modal.
What method do I need to add to a onClick event to prevent this click through from occuring, but still toggling the modal to display?
$('[data-toggle="modal"]').on('click', function(e){
e.stopPropagation();
});
or
$('[data-toggle="modal"]').on('click', function(e){
e.preventDefault();
});
The correct answer is e.preventDefault()

Search in MegaMenu Popup

My company has a MegaMenu on their internal web portal. One of the popup menus has a Search input field which works fine. The problem is that when someone types in the input field and the mouse pointer moves off of the megamenu it, of course, disappears. I need to keep that popup menu open/visible while the user enters the search parameters. Whatever they typed is also invisible until they mouse over the menu item again. Also I am not sure if I should look at onfocus attribute, cursor positioning or a mousemove event.
You need to opt for show/hide on click rather than toggle on hover. So that unless user does not wish to make that hide it is open. As it is convenient for users.

TagCommander - Fire tag at user's click

I'm using TagCommander and I'm trying to fire a specific tag when a user click or scroll within a certain page.
I can easily detect clicks and scroll and fire an event/set a variable according to that, but I can't find a way to fire a Tag when that happens.
My tag should actually fire according to a specific perimeter (a subset of pages) and when a user does some specific action on the page (i.e. click or scroll).
Is there any way to do that?
it's been a while, maybe you found a solution.
To let a click fire, you should go to:
Triggers > edit > choose "Clicks" from the horizontal menu. Under "selector path" insert the CSS selector path of the Button/Link/Call to Action that you want to track. Click on "done".
If you don't know how to select the CSS selector,
go to your website,
open the chrome console,
activate the tab "Elements",
activate the array,
select with the mouse the Button you want to track
in the Tab "Elements" the Elements will be highlighted in its code
if you go on the line all to the left it will appear 3 points (...), click on them and select "copy selection" > CSS Path
it should be something with #, for example #tab1234

Dynamically disabling / enabling the links in a Bootstrap dropdown menu on-click

I understand that bootstrap allows a user to disable links within its dropdown menu component simply by adding a class="disabled" into the corresponding <li> tag.
What I'd like to do is write some javascript so that when a user selects the dropdown menu and clicks on a link within it, that link will become disabled. It's in the nature of the dropdown menu to close immediately when a valid link is selected, or when the user clicks outside of the dropdown box. Therefore when the user opens the menu on any subsequent visit, he or she should see all of their previously selected items appearing as disabled.
I've already tried to use the solutions posted in this link: disable a hyperlink using jQuery, but none of them are working for me.
Using Nagra's above javascript solution in this modified form: $('#my_link').click(function(){$(this).addClass('disabled');}); I am able to add the disabled class to each of the <li> elements whenever a user clicks on the <a> embedded within the <li> parent.
Thank you.

Showing different objects depending on user selection in menu

I have html code where dropdown menu has several values including "Custom". I would like to have different html content below dropdown menu depending on user selection. If user chooses "Custom" value then I need to show one more dropdown menu and two editboxes and if in any other cases I need to show only one editbox.
As I understand I need to use onchange() event and javascript code. Is that right?
Could you please advice?
Thank you.
It seems like you are just getting started with this. Yes, you are probably going to end up using javascript for this. You need to understand that javascript is used to
Modify the DOM (i.e. the html) on the page dynamically
Detect events that happen on different elements of the DOM(e.g. a div or the window).
among other things.
The change event is only one event. Depending on the requirements, you might want to use change, but you might want to show the submenu when the user hovers the pointer over Custom.
Be aware that there are probably libraries you can use to show menus with submenus.
If you want to roll your own, you should try the following:
Show a div that looks like a popup when the user clicks a button or some area of the screen.
Populate the popup with the menu options
Detect when the user mouse-over or clicks the 'Custom' option.
Display the submenu.

Categories

Resources