mardi 2 janvier 2018

How to Show and Update hidden div element by hovering on one of three buttons in Javascript?

I want to hover over on the buttons and want to show a hidden div/panel underneath it by using java script. My Javascript is externally included and works fine, i am trying to use the DOM model to change the style and innerHTML of the div but isnt working. This is my HTML, Javascript and CSS code below. I am even passing parameters to verify which button was hovered but failing. HTML

<div class="container">
     <div class="row anchorbutton">
          <div class="col-sm-4 col-xs-12 col-md-4 col-lg-4">
    <a href=#><div class=" mainbuttons b1 text-center"  
         onmouseover="updatepanel(1);" onmouseout="hidepanel()">Workout 
                                    Programs</div></a>
     </div>
     <div class="col-sm-4 col-md-4 col-lg-4 col-xs-12">
          <a href=#><div class=" mainbuttons b2 text-center" 
             onmouseover="updatepanel(2);" onmouseout="hidepanel()"> Diet 
               Plans</div></a>
     </div>
     <div class="col-sm-4 col-md-4 col-lg-4 col-xs-12 ">
           <a href=#><div class=" mainbuttons  b3 text-center" 
            onmouseover="updatepanel(3);" onmouseout="hidepanel()"> Food 
             Supplements</div></a>
     </div>
     </div>
   </div>
  <div class="container">
   <div class="panel panel-default hidden">
       <div class="hoverable panel-body hidden"> </div>
    </div>
 </div>

JS

function hidepanel(){

var panel=document.getElementsByClassName("hidden");
panel.style.display=none;
}

 function updatepanel(x){
 var desc1="Get fully customized workout programs from our dedicated fitness 
 experts.";
 var desc2="Nutrional advice and diet plans just for your needs!";
 var desc3="Our very own state-of-the-art line of supplementations.Click to 
 Order";

  if(x==1){}
  document.getElementsByClassName('hidden').style.display='block';
  document.getElementsByClassName('hidden').innerHTML='desc1';
  }
   if(x==2){
   document.getElementsByClassName('hidden').style.display='block';
   document.getElementsByClassName('hidden').innerHTML='desc2';
   }
    if(x==3){
     document.getElementsByClassName('hidden').style.display='block';
      document.getElementsByClassName('hidden').innerHTML='desc3';
       }
   }

CSS

.hidden{
 display: none;
 }

I have also tried to change the functionality by changing the function to work on onClick instead of onmousehover but it wont work.Please help me out i have been banging my head.




opening chrome with selenium - weird behavior when opening it with my user

this code does not redirect me to Instagram. when i debug it i see the program just stuck on the "new chrome driver" row. but when i delete the row in the middle (add arguments) it doesnt stuck and does open instagram! didnt find any explanation for this. can someone help?

System.setProperty("webdriver.chrome.driver", "C:\\Users\\gum\\Desktop\\intellijprojects\\Instagram\\chromedriver.exe");
    ChromeOptions options = new ChromeOptions();
    options.addArguments("user-data-dir=C:/Users/gum/AppData/Local/Google/Chrome/User Data");
    ChromeDriver driver = new ChromeDriver(options);
    driver.get("http://ift.tt/1PawXGj");




Remotely run a script from a site

I'm creating a python program that is gathering data from various sources using their APIs and store them in a database. I was planning on this being a cron job that would run nightly on a server. Unfortunately, one of the APIs cost money to use and by my estimate of the amount of requests that my program makes, it will cost around $1.75 every time I want to update my database. It would be much better if I could update it at will instead.

The part that I'm getting stuck at is how to allow a number of people access to update the database. It would be ideal if I could create a website where someone with access could press a button and then it would start running the script in the background. The script takes a couple minutes though and the request would time out. I'm rather novice at web development so I don't know of a solution around this.

How can I have a python script that can take a while run from the press of a button on a website?




GitHub (Web Developer) [on hold]

I will be looking for Web Developer jobs in the new year, I have been subscribed to and been making my way through CodeAcademys Full Stack Developer course the past few months. (I've previous experience in HTML, CSS, Javascript, but not in my current role so looking to stay fresh)

I have my gitHub set up and have been putting some projects on there. Small projects that test me at the end of each section of CodeAcademy. Can I get any tips on how to make the GitHub better for when I put it on my CV.

I've currently a few Javascript projects and now just writing ReadMe files for them to give a breakdown of what the project entailed.

Any help would be appreciated,

Thanks,




How does restaurant website hide file extension in address bar and code in DevTools?

I really like the website for the restaurant Cafe Rio. However the developers have done 2 interesting things and I'm not sure how they accomplished them.

Effect 1: Visit the menu page.

In the address bar of your browser you will see,

http://ift.tt/2kbz9TZ

Why isn't a file extension listed? For example menu.htm. Are they hiding the extension somehow? Is there some other obvious trick that can accomplish this?

Effect 2: On the same menu page click F12 to open DevTools.

I opened DevTools to see if I could figure out how they hid the file extension. Inside I found another mystery. Listed in order I see:

www.caferio.com
  css
  img
  js
  menu

I assume menu is the main document but inside of that doc I don't see any code whatsoever. All that I see is a yellow warning about the SSL certificate. WOW! How are they hiding their code? Thanks so much for any input!




Check command for validity with data from other aggregate

I am currently working on my first bigger DDD application. For now it works pretty well, but we are stuck with an issue since the early days that I cannot stop thinking about:

In some of our aggreagtes we keep references to another aggregate-root that is pretty essential for the whole application (based on their IDs, so there are no hard references - also the deletion is based on events/eventual consistency). Now when we create a new Entity "Entity1" we send a new CreateEntity1Command that contains the ID of the referenced aggregate-root.

Now how can I check if this referenced ID is a valid one? Right now we check it by reading from the other aggregate (without modifying anything there) - but this approach somehow feels dirty. I would like to just "trust" the commands, because the ID cannot be entered manually but must be selected. The problem is, that our application is a web-application and it is not really safe to trust the user input you get there (even though it is not accessibly by the public).

Did I overlook any possible solutions for this problems or should I just ignore the voice in my head that is telling me, that there needs to be a better solution?




Can You Check This out? What Happen? [on hold]

http://ift.tt/2EE586k http://ift.tt/2Cd43AP

I dont know what to do, please click this link to see my problem, i can't fixed this, please help me