Jump to content

JMRKER

Members
  • Content Count

    94
  • Joined

  • Last visited

  • Days Won

    3

JMRKER last won the day on June 9

JMRKER had the most liked content!

Community Reputation

7 Neutral

About JMRKER

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Too little code to help. For example: 1. What does '.toggler' look like? 2. What does the HTML look like? 3. Is any JS being used to trigger the color change? BTW, welcome to the forums. PS: going by the name, not the # of posts.
  2. Here is 'Ingolme's suggestion in a test script. Very similar to original but without <br> <!DOCTYPE html><html lang="en"><head><title> Test Page </title> <meta charset="UTF-8"> <meta name="viewport" content="width-device-width,initial-scale=1.0, user-scalable=yes"/> <!-- link rel="stylesheet" href="common.css" media="screen" --> <style> h1 { /* width: 20em; /* single line */ margin: 0 auto; text-align: center; background: wheat; color: magenta; } h1.vertLine { width: 3em; } /* single vertical line */ h1.twoLines { width: 5em; } /* two horiz. lines */ </style> </head><body> <h1 class='vertLine'> We buy cars city</h1> <hr> <h1 class="twoLines"> We buy cars city</h1> <hr> <h1> We buy cars city</h1> <hr> <script> </script> </body></html>
  3. Example of 'dsonesuk's suggestion: <!DOCTYPE html><html lang="en"><head><title> Test Page </title> <meta charset="UTF-8"> <meta name="viewport" content="width-device-width,initial-scale=1.0, user-scalable=yes"/> <!-- link rel="stylesheet" href="common.css" media="screen" --> <style> h1 { width: 20em; margin: 0 auto; text-align: center; background: wheat; color: magenta; } </style> </head><body> <h1> We buy <br> cars city</h1> <script> </script> </body></html> BTW, welcome to the forums.
  4. JMRKER

    Dropdown menu.

    Here is one very similar that works as you want. Compare codes for inspiration. <!DOCTYPE html><html lang="en"><head><title> Horizontal Drop-down Menu </title> <meta charset="UTF-8"> <meta name="viewport" content="width-device-width,initial-scale=1.0, user-scalable=yes"/> <!-- Modified from: https://www.w3schools.com/css/tryit.asp?filename=trycss_dropdown_navbar also: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_dropdown_navbar_click --> <style> ul { width: 800px; list-style-type: none; margin: 0 auto; padding: 0; overflow: hidden; background-color: wheat; } li { float: left; } li a, .dropbtn { display: inline-block; color: black; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover, .dropdown:hover .dropbtn { background-color: lime; } li.dropdown { display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: wheat; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; text-align: left; } .dropdown-content a:hover {background-color: lime;} .dropdown:hover .dropdown-content { display: block; } .toRight { float: right; } </style> </head> <body> <ul> <li class="dropdown"> <a href="javascript:void(0)" class="dropbtn">Home</a> <div class="dropdown-content"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> </li> <li><a href="#news">News</a></li> <li class="dropdown"> <a href="javascript:void(0)" class="dropbtn">Dropdown 1</a> <div class="dropdown-content"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> </li> <li class="dropdown"> <a href="javascript:void(0)" class="dropbtn">Dropdown 2</a> <div class="dropdown-content"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> </li> <li class="dropdown"> <a href="javascript:void(0)" class="dropbtn">Dropdown 3</a> <div class="dropdown-content"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> </li> <li class="dropdown toRight"> <a href="#" class="right">Enter</a> </li> </ul> <h3>Dropdown Menu inside a Navigation Bar</h3> <p>Hover over the "Dropdown" link to see the dropdown menu.</p> </body> </html>
  5. Seventy items long seems excessive (to me). Is there no way to break the list into smaller groups by being more specific about the contents displayed? I don't know what your dropdown looks like, but as an example for a main heading of "Clothes" followed by all kinds of clothes I would break the clothes topic into smaller groups of 'Shirts', 'Blouses', 'Pants', 'Skirts', 'Ties', 'Scarfes', etc. I think any list longer than about 10 items should be split into smaller lists, even if the split is, for example, by alphabet: a-g, h-o, p-z
  6. If you really need an array, you can convert from a collection to an array with the ES6 spread function. <!DOCTYPE html> <html> <body> <h2>JavaScript Arrays</h2> <p>This "home made" isArray() function returns true when used on an array:</p> <p id="demo"></p> <script> var fruits = ["Banana", "Orange", "Apple", "Mango"]; // not used in this demonstration document.getElementById("demo").innerHTML = isArray(document.getElementsByTagName("p")); // false var parasCollection = document.getElementsByTagName('p'); // same as above document.getElementById("demo").innerHTML += '<br>' + isArray(parasCollection); // false var paraArray = [...parasCollection]; // convert collection to an array document.getElementById("demo").innerHTML += '<br>' + isArray(paraArray) + '<br>'; // true // shows tagName of collection array for (var i=0; i<paraArray.length; i++) { document.getElementById('demo').innerHTML += '<br>' + paraArray[i].tagName +' '; } function isArray(myArray) { return myArray.constructor.toString().indexOf("Array") > -1; } </script> </body> </html>
  7. Don't know what is causing this particular problem, but I removed the anchor links and the drop-down works fine. It might be a place to start further investigations. I don't know enough about PHP to help. <div class="dropdown-user-content" id="dropdown-user-content"> <a href="#"><i class="fa fa-fw fa-user"></i> Perfil de usuario</a> <a href="#"><i class="fa fa-fw fa-envelope"></i> Mensajes</a> <a href="#"><i class="fa fa-fw fa-book"></i> Reglas</a> <a href="#" style="color:red"><i class="fa fa-fw fa-arrow-right"></i> Salir</a> </div>
  8. Nope. You will need to add a database and server location somewhere. BTW, welcome to the forums.
  9. Note addition in "Edited" at end. I was unable to alter posted code to show addition. <style> button { background: orange; } button:hover { background: cyan; } button:active { background: pink; } .active { background: lime; } .active:hover { background: yellow; } </style>
  10. See if this test code can illustrate the actions and use of class .active and HTML active button:active has control only while element has focus as in a mouse click hold down mouse button to see color change with focus <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width-device-width,initial-scale=1.0, user-scalable=yes"/> <title> Active test </title> <!-- For: http://w3schools.invisionzone.com/topic/60288-active-link-should-stay-colored/ --> <style> button { background: orange; } button:hover { background: cyan; } .active { background: lime; } .active:hover { background: yellow; } </style> </head> <body> <div id="btnLinks"> <button> Test 1 </button> <button> Test 2 </button> <button> Test 3 </button> </div> <script> console.clear(); function init() { const sel = document.querySelectorAll('#btnLinks button'); for (const [i, el] of sel.entries()) { el.addEventListener('click', function() { test(el, i); } ); } } init(); function test(elem, ndx) { elem.classList.toggle('active'); } </script> </body> </html>
  11. Add the following just before the final script tag: acc[0].click();
  12. I have no idea where your data is coming from but if you require a JS solution (not PHP) then you could modify this. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width-device-width,initial-scale=1.0, user-scalable=yes"/> <title> HTML5 Test Page </title> <!-- For: http://w3schools.invisionzone.com/topic/60204-how-do-i-express-the-value-of-variables-in-table-cells/ --> <style> table { border-collapse: collapse; border-spacing: 0; border: 1px solid #ddd; width: 25%; } th, td { border: 1px solid black; padding: 2px; } tr:nth-child(even){background-color: #d2d2d2; } /* for table stripes */ </style> </head> <body> <table id="tbl"></table> <script> let $anarchistyes = 1, $anarchistno = 2, $anarchisthuh = 3, $conservativeyes = 4, $conservativeno = 5, $conservativehuh = 6; let tableArray = [ ['Anarchist', $anarchistyes, $anarchistno, $anarchisthuh], ['Conservative', $conservativeyes , $conservativeno , $conservativehuh ] ]; let str = ''; for (let i=0; i<tableArray.length; i++) { str += '<tr>'; for (let v of tableArray[i]) { str += `<td> ${v} </td>`; } str += '</tr>'; } document.getElementById('tbl').innerHTML = str; </script> </body> </html>
  13. JMRKER

    dropdown Menu width

    Before the first <table> tag, you have <tr> and <td> tags without parent <table> tag. Why? Is this a mistake? You have some images within the table that are 900+ horizontal width. Why would you not expect that they might over-run the screen? Your code does not follow the example link to the W3 Schools code very closely. What are you really trying to accomplish? Is the program only meant for people with extra wide monitors? Will it be used by laptops or phone displays? BTW, welcome to the forums.
  14. Sorry ... I just don't see the problem. When I click on the left menu items, it appears to go to a different display. It does not return to the 'print options' page unless I click on that item in the left menu. I am using the FF browser if that makes a difference (?) Or you have already fixed the problem (?)
  15. I am having problems replicating your design. Do you have a link to the site or can you provide the entire HTML, JS and CSS you are using? Also, what is the purpose of using and <iframe> tag? Could you not just link to the site with an <a> tag?
×
×
  • Create New...