Jump to content

eiranix

Members
  • Posts

    66
  • Joined

  • Last visited

Everything posted by eiranix

  1. I have not done anything with php, ajax or databases before and I want to find a simple way to implement a dynamically loading page or pagination to the (small) news page on my site. Has anyone got any tutorials for the simplest method to achieve this? Is there a way to do it without php?
  2. I am linking from a different page so that's not actually a problem. I've realized my problem is not that it isn't working, but that it's doing it in the wrong order... When I use a #linked page it is loading the page and going to the location first, then it's doing the change class function. The new class is expanding content on the page (along with a 0.5sec transition) which leaves the page in the wrong position if it is done to things low enough in the layout. How would I tell it to wait till after the expanding transition has finished before the page moves to the hash location?
  3. Ok this might sound like a stupid question but, how would I go about using the function as above at the same time as linking to a location on the page? When I try using location.hash in place of location.search, the function will work but the location link does not...
  4. eiranix

    IE8 layout help?

    I just figured out what I've been doing wrong....<a> tags around block elements....I didn't realize this was bad. I have converted the divs into list items and put the links within them, making them display as block to get the same result but valid.
  5. OK so what I ended up doing to keep the script small was to remove the ? from the loaction.search and make it a variable that matches the id's of my elements. The page has several elements using class1. Depending on which link takes you there it will cause one of the elements to be class2 on load. window.onload=function() { var id = location.search.substr(1);document.getElementById(id).className = 'class2'; }
  6. eiranix

    IE8 layout help?

    Can anyone help me fix this layout problem I'm having in IE8? Works fine in IE11/Firefox. I don't know what's causing the difference... I have a drop-down menu that works by simply changing the height of the sub buttons container. When I test it in IE8 it puts the sub menu to one side and makes the main buttons extra wide... #header { background-color: blue; position: relative; margin-right:auto; margin-left:auto; width:960px; height:250px; top: 0px;}#nav { position: absolute; width:960px; bottom:0px; left:0px;}.button { border:1px solid green; position:relative; float:left; padding-top:8px; min-width:50px; height:29px; text-align:center; overflow:visible; width:16.66%; background-color: pink;}.button:hover {background-color: red;}.drop { position:absolute; width:160px; top:37px; height: 0px; left:0px; overflow:hidden;}.button:hover #menu1 { height:90px;}.button:hover #menu2 { height:300px;}.sub { font-size:10pt; color: black; height:25px; padding-top:5px; width:100%;} <div id="header"> <div id="nav"> <a href="#"><div class="btn button">Menu1 <div id="menu1" class="drop"> <a href="#"><div class="sub button">Item1</div></a> <a href="#"><div class="sub button">Item2</div></a> <a href="#"><div class="sub button">Item3</div></a> </div> </div></a> <a href="#"><div class="btn button">Menu2 <div id="menu2" class="drop"> <a href="#"><div class="sub button">Item1</div></a> <a href="#"><div class="sub button">Item2</div></a> <a href="#"><div class="sub button">Item3</div></a> <a href="#"><div class="sub button">Item4</div></a> <a href="#"><div class="sub button">Item5</div></a> <a href="#"><div class="sub button">Item6</div></a> <a href="#"><div class="sub button">Item7</div></a> <a href="#"><div class="sub button">Item8</div></a> <a href="#"><div class="sub button">Item9</div></a> <a href="#"><div class="sub button">Item10</div></a> </div> </div></a> </div></div>
  7. Ok great thanks Is this a valid way of writing it?: window.onload=function() {if(location.search == "?link1"){ document.getElementById("box1").className = 'class2'; } }
  8. Is there a way to link to a new page and have that page load a specific function? The idea being that on page1 there are multiple links to the same page2 but they would each call a different function on load...
  9. ...Oh I understand how I can use that now... I would need to put everything in a container with with overflow-x:hidden and min-width set to where I want the scrollbars to kick in.
  10. No, what I mean is the browser's horizonal scroll bar. When the browser is small enough to cover an item protruding to the right side of the side, it will show a scroll bar. I want an element to be out side the browser's viewport without causing those scrollbars to appear...
  11. Is it possible to have an element overhang the right side of the page and be ignored by the browser's scrollbars?
  12. Ok I'll look into it, thanks for your help.I may have to re-think how I want it to behave....
  13. That would work for one row but what about when they start stacking below each other after being shrunk past min-width? I would like them to still expand to the parent when I have two rows of say 3 and 3...
  14. I have 6 divs that I want sitting side by side and have their widths expand to fit the parent equally. But then I also want the 6 divs to start stacking under each other when their minimum-width is reached... Is there a way to do this with css?
  15. Awesome, thanks! I knew it would be something simple. It makes sense that the padding would add to the 100%, it just didn't occur to me in this situation...
  16. Maybe I'm missing something obvious here, but I'm having a problem with max-width when applied to a div with padding. Can anyone tell me what the issue is here? If I have a div that has a max-width of 960px and a width on 100% it works as expected. If I then add padding, the div does not contract with the browser until it has overlapped it a certain ammount. <!DOCTYPE html><html><head><style> .content {width:100%;max-width:920px;padding:20px;background-color:white;height:500px;margin-left: auto;margin-right:auto;}body {margin:0px;padding:0px;background-color:red;}</style></head><body><div class="content">But I must explain to you how all this mistaken idea of denouncing of a pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?</div></body></html>
×
×
  • Create New...