Preserve the default state and the link using cookies

Hello

I don't know where to post this with the re-design of this forum; It has been a while so please forgive me if this is in the wrong g spot.

I have a very basic link, wrapped in a UL tag.

I use JQuery to give links a color when they are clicked by performing a function Add/Remove class, the status of the connection is more preserved by cookies so if a user returns to a page; It shows which tab they were viewing.

The problem is; It is a single page and I want to set a default link or tab; say one. I don't know how to do this.

That's what I'm looking for to accomplished:

  1. A user accesses the page and the first link is red (default)
  2. If the user clicks another link that the link is active and the first link loses its default status
  3. When the user returns the first link is nolonger by default, that's all that bind the selected user on first visit; This is because this link was Micaela using cookies.
  4. The first link will ONLY maintain the State by default, if the user deletes his cookies or visits to the page for the first time.

Here's a piece of JQuery, I used to maintain the selected state:

{$(document) .ready (function ()}

var idActive = $.cookie ('cookieActive');

If {(idActive)

$('#'_+_idActive).addClass ('activeLink');

}

$('_ul_li_a').click (function () {}

ID var = $(this) .attr ('id');

$("ul_li_a").removeClass ("activeLink");

$(this) .addClass ("activeLink");

$('cookieActive', id) .cookie.

$.cookie('cookieactive', id, {expires: 10000});

});

});

I guess your jQuery works the way you want, and the only problem is how to define the default value.

In this case, give your default link an ID, such as "default". Then add an else clause of the conditional statement in your jQuery:

If {(idActive)

$('#'_+_idActive).addClass ('activeLink');

} else {}

$('#default').addClass ('activeLink');

}

Tags: Dreamweaver

Similar Questions

  • Failed to open all the links using safari and mail

    I can't open all links by safari and by e-mail. When I try to open the link it does not work and it will freeze. then I touch the original key two times to close the safari and the e-mail. How can I remedy this?

    Already, I erase history and Web site data and restart my phone.

    Please help me and give me a useful way! Thank you very much!

    As you can see if you read the forum, this is a known issue. Apple is working on a fix.

  • When I hit a link to a page in my directory in code view and I click on the link using live view, it does not to this page.  But if I saw in a browser, it works very well.

    When I hit a link to a page in my directory in code view and I click on the link in live mode view, it does nothing.  When I then go to preview in a browser, it works fine.  Can anyone help?

    To follow links in Live View mode, hold down the CTRL on Windows or the command key on a Mac key, and then click the link. Clicking on without using the Ctrl/Cmd key simply selects the link in Live View mode.

  • Firefox has just begun opeing ads every time I click on the link - use of high disk also reported by Norton

    This morning, I started having a problem with Firefox. I was browsing www.nbcnews.com and when I clicked on a link, a new tab opens with an ad in it. Now, this happens whenever I click on a link. The new tab opens first and normally, he's trying to tell me that there is something or another that must be updated, such as Flash. In addition, Norton reported the use of the disc by Firefox. After that happened, I immediately stopped and am now using Windows Explorer. I don't know what happened, but I'm not happy. I prefer Firefox, but if I can't find out how to get rid of all that was installed without my knowledge, I do not use Firefox more. Have you seen this? Do you know how I can fix this problem? I have watched my modules and I saw that I do not recognize and I removed it. The problem persists. I can try to uninstall and reinstall Firefox, but the parameters normally do not disappear. Is it possible that I can completely uninstall and start again? Hope you can help.

    Hello

    Try Firefox Safe mode to see if the problem goes away. Safe mode is a troubleshooting mode, which disables most of the modules.

    (If you use it, switch to the default theme).

    • Under Windows, you can open Firefox 4.0 + in Safe Mode holding the key SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac, you can open Firefox 4.0 + in Safe Mode holding the key option key when starting Firefox.
    • Under Linux, you can open Firefox 4.0 + with leaving Firefox then go to your Terminal and running Safe Mode: firefox-safe-mode (you may need to specify the installation path of Firefox for example/usr/lib/firefox)
    • Or open the Help menu and click on the restart with the disabled... modules menu item while Firefox is running.

    Once you get the pop-up, simply select "" boot mode safe. "

    If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to understand that one. To do this, please follow article Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems .

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. It might help others who have the same problem.

    Thank you.

  • Fire of process on click of the link using query type

    APEX 3.2.0.0.27

    I have a report region based on a qry with links. Each line has a link to separate the region on the same page. I want a process to fire (manual data select the process for the region linked) when the link is clicked. The link is displayed as a button change. I set the link for an application. How to identify the application that should fire when the user clicks on the link. I also defined a separate button named: QRY. The actual process (after submit process) it's fire is conditionial on the express request = 1 IN the expression 1 column, I entered the name of the button (QRY).

    However the after submit the process is not fired.

    So, how to correlate the process consisting in fires when the user clicks on the link. Do not confuse the link which is represented by a button here, but in fact I have this link button, but also a 'normal' button which bears the name of QRY. When I click on the actual button named QRY then my process is triggered. However, it did not when the user clicks on the link 'button '.

    What I am doing wrong?

    So what you have is lines of report that can be presented in many ways, as well as the value of an other Item (Hidden)

    Can think of two ways

  • 1 concatenate the PK value with the request, use the PLSQL substr (substring) on demand to identify the type of demand but also to extract the value of the KP.

    JavaScript: doSubmit('SAVE_#PK_COLUMN_ALIAS#');

    Request: SUBSTR (: REQUEST, 1, INSTR(:REQUEST,'_')-1) and PK value is SUBSTR (: REQUEST, INSTR(:REQUEST,'_') + 1)
    Then assign the item suitable in a bidding process

  • Another method is to assign the item directly

    JavaScript: $s('','#PK_COLUMN_ALIAS#'); doSubmit('SAVE_#DEPT_NAME#');

    Replace the with the name of the page to put element
    Make sure that the item is not protected (this is the default option for the hidden items)

  • The default value and after that use it as control

    Hello
    Currently I'm doing engine of labview, and I am facing a problem.
    When I connect to my Board of Directors through labview, it will relay last position to the global variable. After that, I have to go to loop, where I can refer change position to my narcotics control engine
    In short, I must control number, but this default value must be written by another function when I run vi.

    no idea how to do it?

    Let me know if any clarification is needed

  • How do I set GT 650 M by default permanently and do not use the integrated graphics card?

    I want HP dv7-7212nr. It has graphics card Intel HD 4000, which is shown in dxdiag and a GT 650 M.

    I have HDMI and VGA cables.

    How I put it that GT 650 M is the main and showed on dxdiag?

    This configuration is in the BIOS, or I can do on the desktop? If so, how?

    Thank you in advance!

    Perfect. Thank you!

  • Maintain the rollover State for clicked links - session cookies

    Hello!

    I have a series of button images on all of my web pages, and I want to keep their rollover State individually when I click on them and go to another page and back. It is perfectly correct for the cookie that is deleted when the browser closes.

    I used dreamweaver swapimage behavior and remove the swap image restore behavior which is standard.

    This way the user of my site could see where they had been on a page, even if they leave and come back.

    I think it's an effect for many users?

    Thanks for any help!

    I assume that you set the value of a link clicked on TRUE cookie.

    At the bottom of the page, just above the tag, you need something like this (repeat the line for EACH image ID if)-

  • I remember early versions of Firefox had a menu item by which you could share the link to a web page, you have read, what happened?

    I often read web page items that I would like to share with my friends. I think that once there is a menu item that allows you to send the link, using your own e-mail program, to a friend. That happened to her, or well, I remembered it from another browser? Your response is much appreciated.

    You can find it in two places now:

    (1) there is an icon for the function of email link that you can add to a toolbar. It is available in the collection of unused icons when you enter the customization mode. See: Customize Firefox commands, buttons, and toolbars.

    (2) If your toolbars and the menu graphics are already filled, you can use the classic file menu. If you don't regularly display the menu bar, you can press the ALT key, or press F10 to display temporarily. So he's under file > email link.

    If you have not used it for a while, you may need to configure Firefox to work with your favorite e-mail program or your site: change the program used to open links in e-mail. Unfortunately, the webmail configuration may be missing or glitch, so if it doesn't work, please post back on this site mail you try to use any other suggestions.

  • Open the link to native app on AppWorld of Runtime Android application

    I am able to open appworld android Runtime application using this code

    final intent intent = new intent (Intent.ACTION_VIEW, Uri.parse ("market://details?id=com.mycompany.myapp"));
    context.startActivity (intent);

    But as native applications have no package name what do I need to open the native application in AppWorld runtime android app? I have an app for the app id.

    If I try to open the link using the following code

    final intent intent = new intent (Intent.ACTION_VIEW, Uri.parse ("http://appworld.blackberry.com/webstore/content/1321456"));
    context.startActivity (intent);

    the playbook and then I get a page with the message that you are not allowed to open this page. appworld://content/1321456

    SOLVED. Native applications have bundle id. It can be used in the package of the android app to open the link on AppWorld

  • See the list of cookies in the maximizable window

    Cookie Viewer integrated Firefox has a limited size window (small format) 20 and unadjustable. It is not convenient for navigation to countless cookies (it is actually not practical). Is there a way to look at the list in a window of adjustable size? I want to maximize the viewing window.

    Hmmm, what kind of dialogue do you use? That includes cookies under the domain name is extensible. There a resizer on the lower right corner, but it's faster to double-click on the title bar of the dialog box.

    One I think can be opened from here:

    the button Firefox orange (or the Tools menu) > Options > privacy

    Use the 'Show Cookies' button (if you have the story set to 'Customize') or on the link 'delete cookies '.

    In the case where I did something special to change in a resizable window, I'll check that after validation.

  • I get the following message when you use Safari and Firefox. Works in Chrome: "we're sorry, the link that brought you to this page is not valid."

    I'm working with my bank account online and I get to the homepage very well. When I select the online banking, estatements, I get the following message when it tries to link to the electronic statement page.
    "We're sorry, the link that brought you to this page is not valid." Chrome has no problem displaying this page, but Firefox and Safari gives me the same message.

    Note that I posted this already above, but don't not checked if she was tried.

    You may need to allow cookies from third party (visited or all).


    To view the history settings and cookies, choose:

    • Firefox > Preferences > privacy > Firefox will be: "use the custom settings for history".
  • Using firefox 14.0.1. Load a link using the right click and "Open link in new window", translates into a new window opens but doesn't show URL address bar...

    Using firefox 14.0.1. Load a link using the right click and "Open link in new window", translates into a new window opens but doesn't show URL address bar. However, if I click with the right button on a link and select "Open link in a new tab", the tab displays the URL in the address bar. If it works when a new tab it's not in a new window.

    The reset Firefox feature can solve a lot of problems in restaurant Firefox to its factory default condition while saving your vital information.
    Note: This will make you lose all the Extensions, open Web sites and preferences.

    To reset Firefox, perform the following steps:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the button 'Reset Firefox'.
    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    Information can be found in the article Firefox Refresh - reset the settings and Add-ons .

    This solve your problems? Please report to us!

  • Opening links in a new tab will also load the link on the problem of temporamental currnt tab that comes and goes. Sometimes using links from google as well.

    Opening links in a new tab will also load the link on the problem of temporamental currnt tab that comes and goes. Sometimes using links from google as well. Never had this problem before. Also the SafeSearch feature on google has itself locked on strict, not too much problem, but has happened at the same time my links and tabs not working like I want.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • What are the advantages and disadvantages of using iCloud drive (or other Cloud services) compared with iTunes game against external hard drive, Solid State etc. to store my songs iTunes, playlists, ratings etc?

    First question: what are the advantages and disadvantages of using iCloud drive (or other Cloud services) compared with iTunes Match against Solid State external hard drive etc to store my songs iTunes, playlists, ratings etc?

    Please let me know what are the alternatives for storage of my songs, playlists, song etc. other than iTunes game ratings ($ 24.99 / year)?  Is there a way to store all my songs with my song ratings, playlists, etc. with a CD song quality? Most of my (currently 130 GB) songs on my computer are CD quality that I prefer to keep as well as my notes of each song (i.e. 5 * vs. 4 * etc.), playlists, groups (music, classical, popular, country etc.).  What are the advantages and disadvantages to store my iTunes songs while CD quality with my personal notes, reading lists, groupings in the cloud?  ICloud of Apple Drive ($ 2.99 per month or $36 / year for 200 GB) would be the best way to automatically update and maintain my rankings iTunes personal including the future editions of the song etc or using Amazon, IBM, Microsoft etc cloud or an external hard drive SSD would work as well and maybe cheaper?  I currently have my iTunes on a PC of 2007 with vista (I use a 1 8T Western Digital external upward by car for my personal info all over HP, songs, photos etc. which is currently close to 170 GB) but also have an Apple i-phone 6 & I Air cushion.  Although I did not need to have all of my music with all their sides, etc. available on all of my devices at all times as iTunes game, I still would have easy access to information on both my PC and my iPhone or iPad?  Thank you.

    In my opinion?

    I back up my data to an external drive for several reasons.  The first is my data - if I put on the cloud, someone else has control over it, they can see what I have and change the preferences to what they see of marketing.

    Almost as important as that - if I had to rely on the cloud whenever I wanted to update my playlists on my phone, I need a better internet connection I have now (working at sea).  To get the best out of the cloud, you need a solid link to home, work or mobile.

    As a spin-off - I hate the fact that Apple take away a feature in their software updates and then allow an app to be sold in their store to replace this feature - or worse still, some features that were available before the updates are now "cloud only."  And Yes - you have to pay for the cloud.  I like most of the people do not appreciate the 'accomplished fact. "

    From the back of the external hard drive ASI downside, is that to be safe, you need to store outside in a separate computer place.  If keep you them together, if one is lost, probably, they are both.  That is to say for me a full backup before you travel, then a new upward as soon as I go home.  Downside is how much data may be lost between the two back ups if I needed to restore.  For me, its worth the risk.  If I was away and say had bought a ton of new music and couldn't go home anytime soon, I can always head to the store and buy a new external drive, they are massively expensive.  Even if my computer has to go for repair and my remote is to halfway around the world - I want to buy a new one.

    Now, some will say that once you buy a new external, you spend more than you would on a cloud subscription.  It's true, but in the 6 years following the purchase of Mac that I've only had to buy a new external once - so with a little luck and planning - it works.

    I left took well - I am not a subscriber of cloud, nor do I want to be.

Maybe you are looking for