Making a button dissapear once clicked.

Hi,
I've created a button which makes a div appear. But what I want to know is make the button either dissapear once clicked or change its function and name to make the div dissapear.
Problem is I have already used the onClick function, here is the code
<script language="JavaScript">
function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
</script>
HTML:
<p><a href="#" onclick="setVisibility('hidden', 'inline'); this.onclick=function() { return false; };";>See More</a></p>
      <div id="hidden"><time>12/10/2010</time>
      <br />
      <p>Production for No More's music video is under way amd will be with you soon. </p><time>12/10/2010</time>
      <br />
      <p>Production for No More's music video is under way amd will be with you soon. </p>
      </div>
Any help would be appreciated.
Tom

Thats amazing as usual! Works perfectly.
New problem: I've now added a "read less" button that then hides the 'hidden' div. It goes a little something like this:
     <p><a href="#" id="hoohaa" onclick="setVisibility('hidden', 'block');setVisibility('hoohaa', 'none');return false;">Read More</a> </p>
     <div id="hidden">
     <br />
     <p><a href="#" onclick="setVisibility('hidden', 'none');";>Read Less</a></p>
     <time>12/10/2010</time>
      <br />
      <p>Production for No More's music video is under way amd will be with you soon. </p>
      </div>
Can I make it so when you click read less the 'read more' button reappears.
Cheers
Tom

Similar Messages

  • How do I create buttons that once clicked and un clicked, alter an image? ...

    How do I create buttons that once clicked and un clicked, alter an image?
    So for example if I imported a psd file into Muse with 5 layers, could i create 5 buttons which, when clicked, each individually took off and added 1 layer?
    Basically this should make what i'm trying to say clear (when it's loaded click the arrow and you'll see): http://lust.nl/lustArchive/noordzee/noordzee.html
    Appreciate any help

    Hi Joe,
    Please use this option to hide the target on click - http://prntscr.com/3plqn0
    - Abhishek Maurya

  • How can I turn-off the apps which I have opened once in ISO 7.0.2. In previous version of ISO it was easy to turn- the opened apps by double clicking on home button and then click and hold on respective apps then click on cross sign.

    How can I turn-off the apps which I have opened once in ISO 7.0.2. In previous version of ISO it was easy to turn-off the opened apps by double clicking on home button and then click and hold on respective apps then click on cross sign but in this version I could not do so and my iPad appears slower.

    Close inactive apps
    1. Double tap the home button to bring up the multi-tasking view
    2. Swipe the app's windows upwards to close
    3. The app will fly off the screen

  • How do I stop a Movie Clip (Button) from working once clicked?

    Ok,
    I'm using a movie clip as a button to show content on a page, effectively its like a new page of the website. Problem is, with the script im using for it, once the content is show, the button is still active and if clicked again, will re-load the content. I want a way to effectively disable the button whist the content is shown.
    Thanks.
    this.services_inner.buttonMode = true;
    this.services_inner.addEventListener(MouseEvent.MOUSE_OVER, rollOver_services);
    this.services_inner.addEventListener(MouseEvent.CLICK, onClick_services);
    function rollOver_services(evt:MouseEvent):void {
    this.services_inner.play();
    function onClick_services(event:MouseEvent):void {
    MovieClip(root).mov.backgrounds.colour.gotoAndPlay(2);

    Thanks, that does stop it, however, i now need it to work again if a different button is clicked... there are 4 buttons (movie clips) in total, so I assume I'd just need to add the event listener back again on click of the others?
    This is the "Services" Button, with the event listener removal.....
    this.services_inner.buttonMode = true;
    this.services_inner.addEventListener(MouseEvent.MOUSE_OVER, rollOver_services);
    this.services_inner.addEventListener(MouseEvent.CLICK, onClick_services);
    function rollOver_services(evt:MouseEvent):void {
    this.services_inner.play();
    function onClick_services(event:MouseEvent):void {
    MovieClip(root).mov.backgrounds.colour.gotoAndPlay(2);
    this.services_inner.removeEventListener(MouseEvent.CLICK, onClick_services);
    This is the "Contact" Button, which when clicked would need to "re-activate" the Services button.
    this.contact_inner.buttonMode = true;
    this.contact_inner.addEventListener(MouseEvent.MOUSE_OVER, rollOver_contact);
    this.contact_inner.addEventListener(MouseEvent.CLICK, onClick_contact);
    function rollOver_contact(evt:MouseEvent):void {
    this.contact_inner.play();
    function onClick_contact(event:MouseEvent):void {
    MovieClip(root).mov.backgrounds.art.gotoAndPlay(2);
    this.services_inner.removeEventListener(MouseEvent.CLICK, onClick_contact);

  • Keep a button set to Hover once clicked

    Hi,
    I was wondering if there was a quick way to set a button to
    it's hover state once clicked?
    I know how to do this by having it be a movie clip and
    changing its time line position onRollOver. onRollOut and
    onRelease. I am just trying to do this quick using a button so
    didn't want to deal with all that. Thanks!

    it takes a bit of Actionscript - but yes, its possible. --and
    instead of using a button, use a movieClip - and assign the actions
    on the main timeline.
    I'll use _xscale in my example, but you can do the same
    thing, and just put your "rollOver effect" on frame 2, and use
    gotoAndStop();.
    mc.onRollOver = function() {
    mc._xscale = 110;
    mc._yscale = 110;
    mc.onRollOut = function() {
    if (testV == true) {
    mc._xscale = 100;
    mc._yscale = 100;
    mc.onRelease = function() {
    if (testV == false || testV == undefined) {
    testV = true;
    } else if (testV == true) {
    testV = false;
    }

  • How to click several buttons at once on Popup Message

    hello
    I have been creating 5boutons on Popup Message [ "Can1", "Can2" .....] and that we can click once to execute the programm eg Can1Sequence or Can2Sequence.
      I 'like to know if it is possible to click on two buttons at a time that is to say can click the same button twice or clicking two different buttons and can execute both programs in parallel.

    Dennis_Knutson a écrit :
    Why aren't you using either the batch or parallel model? The gui for either allows you start one or more threads. There are some examples that come with TestStand. There is even one called OverrideSerialNumForBatchModel where the PreBatch callback is used. This can be modified to pop up your own dialog.
    how was that during the execution of the test we have the opportunity to press two buttons below there is a picture. For 5 buttons I have used Popup Message at this time and can not be as pressing a button (so when I press a button the image disappears below and choose Test to execute).
    at this time I ask myself if this is possible with Message Popup.
    if possible I'd like as after the second stage with two "Sequence Call" to call the respective functions (that is to say if it was based on CH1 and CanX, then Can1Sequence functions and Can2Sequence be delivered). I will like to use Parallel execution.
      "OverrideSerialNumForBatchModel" is difficult for me, because I do not know if it will be possible with what I have just described, and I do not understand how its function
    Attachments:
    Select Can.PNG ‏11 KB

  • Two questions: First, the homepage button on my browswer has stopped working. Once clicked, nothing happens. Second, when I try to upload pics to blogger, it says "Server Error".

    The homepage button has stopped on both my desktop and netbook browser, as about about a week ago. Once clicked, nothing happens. Yet all other browser buttons are working fine. Second, when I try to upload pics to blogger, it says "Server Error".
    The server error message on blogger happened about the same time, and although there have been rare occasions where it worked, but mostly it doesn't. I've tried a couple of times every day, and it's only worked twice. But I am able to do it on other browsers, leading me to believe it's a firefox problem. (For the record, blogger seems to have recently updated their pic upload feature).

    This usually happens if Spotlight is disabled on a drive. When you tried MacPilot, did it have an option to disable Spotlight? I haven't used the app, so don't know whether that is the case or not, but if it did and you inadvertantly, or even deliberately, disabled Spotlight then the Finder won't display anything but the most basic information about a file--thus you won't see dimensions or Last Opened, just size and dates created and modified.
    Francine
    Francine
    Schwieder

  • Making a video appear by clicking a button on that same state.

    I have a state that I want to open which has an image background and buttons to the side. When a user clicks on one of the buttons I want the video to appear over the graphic. Is there a way to do this?
    I also need to have different movies play in that same player based on which button the user clicks on in that state. Is that possible too?

    Best way is to have a separate state that's a copy of the first, just with a video player. An alternative is to do something like set the opacity on a button click to take a video player from invisible to visible.
    In terms of playing different videos, just have each button set the source property on the video player. On Click > Play Action Sequence > Set Property > Source.
    -Bear

  • Home button stops registering clicks every once in a while (after about a week or two, until I reset it) and feels loose. If I take it into a retail store, will I be able to get a replacement?

    Every week or two, my home button stops registering clicks randomly. I double-click to activate the app switcher, and it only registers one click and sends me back to the home screen, or it misses them altogether. I've tried every method I could find on the internet, and nothing has stopped this problem.
    Will an Apple genius give me a replacement if I bring it into the Apple store, even if I can't replicate the issue to show them?

    Regardless of what anyone else reports, it's entirely up to Apple what they will do on an individual case basis.  If your phone is still under warranty or AppleCare, and they determine that the malfunctioning button us due to a defect rather than abuse, you would be entitled to a replacement with a refub phone.  If out of warranty or due to abuse, you could get an out of warranty replacement for $199 (US).

  • Making a button appear on a track

    I've searched here and in the manual but I'm not sure I'm searching for the right thing. How can I make a button appear within a stream so the user can link back to a menu?
    puzzled.....
    Thanks

    It's done in DVDSP by using 'buttons over video'. Basically, you use the subtitle stream to add the text that you want for the button (or graphic, if you import one as a subtitle).
    Once you have set the markers for the start and end point of where the button will appear, click in between them in a spare subtitle stream, type the word you want and then click on the editor window to see it appear. From here on in you can use the window as you would when making buttons on a menu - drag out a button rectangle, set the target and so on.
    Make sure that you force the sub to view...
    On playback, the button will appear as a part of the subtitle. You need only press the 'enter' key on your remote control to activate it, unless you have created more than one button... in which case you need to use the arrow keys to get to where you want to be before you activate the button.

  • How do i save the fact that a button has been clicked.

    So im creating a game in which I collect objects that represent money.After I die in the game i get into the Shop Class in which i can buy different items depending on the money i have. So lets say that after dying i have enough money to get item1 and item2. So i Click on button1 (representing item1) andbutton2 (representing item2) (when clicked their alpha gets to 0.5) and start the game again.Ok so now i have 1 life more and i get more money.But suddenly out of nowhere i feel something strange deep in me, something that i have never felt before -> HUNGER,
    I shut down the PC and run as fast as possible to the nearest shop.
    //lets say item1 is : +1life and item2 is : get more money from objects
    After I had satisfied my primal needs I feel the strong urge to play that awesome game of mine again. But when i start the game I start to see some strange things: It seems that I havent got one life moreand neither do i get more money and just to be sure that Im not hallucinating (or that i didnt rememer the lifes i had last time) I die on purpose so the Shop menu shows. So now what I see is making me sad -> button1 and button2 are active and have an alpha of 1( and that means that the game thinks that they were never bought/clicked, that i have never played this game before in my life) So i go crazy (cause all that play before was for nothing and i have to start all over again).
    After i calm down, I decide to change my life. 1st BIG change is adding some code into the game. To be more specific: a method that will save the items that i bougth, so when i close the game and start again the things i see will bring joy to my life - >: I still have the items that i bougth last time.
    So long story short:
    how do i make that when i click a button (it changes its alpha to 0.5)and close the FLA , whenever i open the same FLA, the button that i clicked before will be shown as clicked now(it alpha will be 0.5)
    I know it has to be with sharedObject and yet i dont know how
    currently i have this:
                            private var savedData:SharedObject = SharedObject.getLocal("sharedStorage12");
                        private var buttonInfoArr:Array = [];
                        private var numberOfSavedObjects:int = 0;
                        private var brokenBtnArray:Array = [];
                        public function Main()
                                   for (var i:int = 0; i < 4; i++)
                                            var myImage_mc:MovieClip = new MovieClip();
                                            myImage_mc.graphics.beginFill( 0xFFFFFF * Math.random() );
                                            myImage_mc.graphics.drawRect(0,0,100,100);
                                            myImage_mc.graphics.endFill();
                                            myImage_mc.x = 50 + i * (myImage_mc.width + 10);
                                            myImage_mc.y = 100;
                                            myImage_mc.name = "myImage_mc" + i;
                                            this.addChild(myImage_mc);
                                            myImage_mc.mouseEnabled = true;
                                            myImage_mc.buttonMode = true;
                                            myImage_mc.addEventListener(MouseEvent.CLICK, onClick);
                        private function onClick(ev:MouseEvent):void
                                  var thisButton:MovieClip = ev.currentTarget as MovieClip;
                                  trace(thisButton.name);
                                  thisButton.alpha = 0.5;
                                  thisButton.buttonMode = false;
                                  thisButton.removeEventListener(MouseEvent.CLICK, onClick);
                                  buttonInfoArr.push( thisButton.name );
                                  savedData.data.myArray = buttonInfoArr;
    How do i use that savedData or how would you do it?
    PS: can it be done without Dictionary class, cause i still havent grasp my mind over it.

    what do you mean by game-state
    PS: i asked this question and they told me to be more specific.

  • Making a button go to a specific frame

    I'm having trouble with this.  I'm just practicing for the moment and not expert in flash code at all.  I have a button on frame #1.  On that frame, I used the following code I found on the web (which I tried using both AS2 and AS3):
    stop();
    function buttonClick(event:MouseEvent);void{
    gotoAndPlay(2);
    I get errors of varying sorts.  What should I use?  AS2 or AS3?  And what code should I assign to the button (or that button's frame?) to get it to go to frame 2 once clicked?

    The code you show is an incomplete/incorrect attempt to use AS3.  For AS3 you need to assign an instance name to the button and then assign an event listener to the button using the instance name to target it.  The code goes in the frame of the timeline that coincides with the button's frame (preferably on a separate layer for actionscript).  So if you gave the button an instance name of "btn", the complete/correct code for it would be...
    stop(); // this is a timeline command, not a button command
    btn.addEventListener(MouseEvent.CLICK, buttonClick);
    function buttonClick(evt:MouseEvent):void {
         gotoAndPlay(2);

  • Can we perform two actions with one button with two clicks one after other?

    Sir,
    can we perform two actions with one button with two clicks one after other?
    I want that when I click an Add Button first time it add data to the database and when I click again this button it clear the form data to empty fields.
    Regards
    Tanvir

    In code it should be easy.
    The following code adds a button called butman with a text "ADD".
    It then registers a listener that will be called if the button is clicked.
    This listener then calls the runAddData method if you clicked on butman while it contained the "ADD" text and it will call the runClearData method otherwise.
    Therefore it will swap the button's functionality between ADD and CLEAR on every click.
    final Button butman = new Button("ADD");
    butman.setOnAction(new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent t) {
                        if (butman.getText().equals("ADD")) {
                                  butman.setText("CLEAR");
                                  runAddData();
                        } else {
                                  butman.setText("ADD");
                                  runClearData();
                        } // END IF-THEN
              }});I hope this is what you wanted.
    Some extra food for thought.
    You might want to run the ADD and CLEAR methods in their own threads so that it can run in the back ground, without slowing down your user interface.
    I also like to rather reuse one button for multiple functionality in stead of making an application with hundreds of nodes only used rarely with masses of code to show and hide them if needed.

  • How to fire "table change" once click other regions outside the table erea?

    I have a JTable created with DefaultTableModel. Usually the edit behavior of table cell is like this:
    1) Select one cell, it is highlighted in blue.
    2) Double click the cell, it's made editable with white background.
    3) Two scenarios
    (a) Once finish edit, press "Enter", the cell background turns from white to blue. At the same time, the table change is "fired" .
    (b) Once finish edit, click another cell, the originall cell turns white, and the new-clicked cell is highlighted in blue. At the same time, the table change is "fired".
    4) While editing one cell, and click somewhere OUTSIDE the table area. In this case, the table change is NOT fired.
    [This cause a confusion, user sees the changed text in table cell, but actually it is not stored and will not be stored in the table.]
    So what I want to implement is: once click the region outside the table, the text in that editabe cell (where you are just editing) is stored and fired.
    Can you help me? Thanks in advance!

    sabre150 & other experts,
    [see background in my first message]
    User is still not completely satisfied with the current behavior, though "table changed" can be fired when clicking other controls(eg. buttons or checkboxes).
    If I click a panel region(instead of a particular control), the "table changed" can not be fired. However, it is expected.
    I guess the reason is:
    a panel doesn't has a focus. so when clicking panel, the focus is not "lost" to the table cell.
    Any hints?

  • Making a file available once e-learning has been published

    Hi,
    I am using Captivate 5.5 to make e-learning. I'd like to include a PDF file but once I publish it to our MOODLE system the PDF file is no longer accessible. What am I doing wrong/what should I be doing?
    Thanks,
    Emma

    Hi,
    In the e-learning I am inserting a button, which when clicked is meant to 'open URL or File'. What I would like to happen, is when this button is clicked it opens up a PDF document (which will be a certificate).
    When I then publish the e-learning to a zip file (ready for uploading to our MOODLE VLE platform), I don't know what to do with the PDF to ensure that it opens once the e-learning is viewed in the VLE.
    It appears I have to save it somewhere, but where would that be? I've tried saving it in the zip file which is the e-learning package, but it says the document cannot be found. I've tried putting the e-learning package and the PDF in a folder but when I try to upload it to our VLE I get told ' imsmanifest.xml or AICC structure'
    Thanks,
    Emma

Maybe you are looking for