Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


JMRKER last won the day on June 9

JMRKER had the most liked content!

Community Reputation

7 Neutral


  • Rank

Recent Profile Visitors

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

  1. Add the following just before the final script tag: acc[0].click();
  2. 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>

    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.
  4. 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 (?)
  5. 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?
  6. Although this is the JS forum, there is a non-JS solution for programming completeness only. <!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> Hide/Show CSS only </title> <!-- For: http://w3schools.invisionzone.com/topic/60050-toggle-hideshow/ --> <style> #myDIV { width: 100%; padding: 50px 0; text-align: center; background-color: lightblue; margin-top: 20px; display: none; } #myBtn:checked + div { display: block; } label { border: 1px solid black; border-radius: 5px; background: lightblue; padding: 0.5em; } </style> </head> <body> <label for="myBtn">Click Me</label> <input type="checkbox" hidden id="myBtn"> <div id="myDIV"> This is my DIV element. </div> </body> </html> Moderators can move to CSS section if deemed appropriate.
  7. Show some example code of what you have done as a starting point. How do you want it to differ from the example link you gave?
  8. Three different functions that demonstrate: 1 (wheat color background): Successful match 2 (pink color background): Unsuccessful match <!DOCTYPE html> <html> <style> #demo1 { background: wheat; } #demo2 { background: pink; } </style> <body> <h1>Array includes()</h1> <!-- From: http://w3schools.invisionzone.com/topic/59508-javascript-search-if-a-word-is-inside-an-array/ --> <p><strong>Note:</strong> The includes method is not supported in Edge 13 (and earlier versions).</p> <p>Check if the fruit array contains "Mango":</p> <p id="demo"></p> <pre id="demo1"></pre> <pre id="demo2"></pre> <script> const lookFor = 'Mango'; var fruits = ["Banana is yellow", "Orange juice", "Apple is red", "Mango is orange"]; document.getElementById('demo').innerHTML = `Original Array: fruits<br> ${fruits.join('<br>')}`; checkFor('demo1', lookFor); checkFor('demo2', 'XXX'); function checkFor(dw, lookFor) { document.getElementById(dw).innerHTML += `<p />Look for in 'fruits' array: ${lookFor}`; var n = fruits.includes(lookFor); document.getElementById(dw).innerHTML += `<p />fruits.includes(${lookFor}): ${n}`; var n1 = fruits.findIndex(element => element.includes(lookFor)); document.getElementById(dw).innerHTML += `<p />fruits.findIndex(${lookFor}): #${n1} ${fruits[n1]}`; var n2 = fruits.filter( function(x) { return (x.indexOf(lookFor) != -1) ? x : ''; } ); document.getElementById(dw).innerHTML += `<p />fruits.filter(${lookFor}): `+n2; } </script> </body> </html>
  9. Do you have some small amount of code sample? The picture is too small to read.
  10. JMRKER

    animated CSS arrows

    Where exactly in the CSS or HTML is that statement to be added? Thanks.
  11. Welcome to the forums. Your question is kind of broad for me. Can you give a more specific example of what you wish to accomplish? If you just want some general direction, try googling Flexbox or Grid layouts with CSS.
  12. No. I'm just not interested in reading through 18.31kB of code. You should at least be able to isolate your problem to a page or two of code with a small example.
  13. This is not a count-down example, but it does illustrate the use of Date.toUTCDString() and Date.toString() functions. You should be able to modify for your needs along with the set Date() functions, if necessary. <!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> .toUTCString / .toString </title><!-- link rel="stylesheet" href="common.css" media="screen" --><style></style></head><body><h1> Displays in console.log </h1><pre id="demo"></pre><script>const doc = (IDS) => document.getElementById(IDS);/* send console.log to element in body via assignment */// following modified from: https://stackoverflow.com/questions/16616722/sending-all-javascript-console-output-into-a-dom-elementvar former = console.log; // retain former actions of console.logconsole.log = function(...msg){ former(...msg); // maintains existing logging via the console. (optional) doc("demo").append(msg.join(' ')+'\n'); // output needs to be specified}</script><script> console.clear(); const Months = ['January','February','March', 'April', 'May', 'June', 'July', 'August', 'September','October','November','December']; const Days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; Array.prototype.lookFor = function (str) { // returns index of found string or -1 if not found let arr = this; for (let i=0; i<arr.length; i++) { if (arr[i].indexOf(str) != -1) { return i; } } return -1; } var getDaysInMonth = function(month,year) { // Day 0 is the last day in the previous month // return new Date(year, month, 0).getDate(); // Here January is 1 based// Alternative: return Number(new Date(year, month+1, 0).getDate()); // Here January is 0 based }; var getDayOfYear = function(year,month,day) { // Here January is 0 based; var tot = 0; for (let m = 0; m<month; m++) { tot += getDaysInMonth(m,year); } return tot+Number(day); }; Date.prototype.dayDiff = function(d) { return Math.floor(Math.abs(this-d)/86400000); }; console.clear; console.log('new Date.toUTCDString()\t',new Date().toUTCString()); var [day,date,mo,year,time,zone] = new Date().toUTCString().split(' '); console.log('Days-In-Month\t: ',getDaysInMonth(Months.lookFor(mo),year)); console.log('Day-Of-Year\t: ',getDayOfYear(year,Months.lookFor(mo),date)); console.log('Long month\t: ',Months[Months.lookFor(mo)]); console.log('Long day\t: ',Days[Days.lookFor(day.substr(0,3))]); console.log(); console.log('\nnew Date().toString(): \t',new Date().toString()); var [day,mo,date,year,time,zone,...rest] = new Date().toString().split(' '); console.log('Days-In-Month\t: ',getDaysInMonth(Months.lookFor(mo),year)); console.log('Day-Of-Year\t: ',getDayOfYear(year,Months.lookFor(mo),date)); console.log('Long month\t: ',Months[Months.lookFor(mo)]); console.log('Long day\t: ',Days[Days.lookFor(day)]); console.log(); console.log("Butch's BDay"); console.log('new Date().toString(1947,7,16): ',new Date(1947,7,16).toString()); var [day,mo,date,year,time,zone,...rest] = new Date(1947,7,16).toString().split(' '); console.log('Days-In-Month\t: ',getDaysInMonth(Months.lookFor(mo),year)); console.log('Day-Of-Year\t: ',getDayOfYear(year,Months.lookFor(mo),date)); console.log('Long month\t: ',Months[Months.lookFor(mo)]); console.log('Long day\t: ',Days[Days.lookFor(day)]); var today = new Date(), Jbday = new Date(1947,7,16), daysbetween = today.dayDiff(Jbday); console.log('days between\t: ', daysbetween, 'days or', (daysbetween/365).toFixed(2), 'years'); console.log(); console.log("Spike's BDay"); console.log('new Date().toString((1951,6,30): ',new Date(1951,6,30).toString()); var [day,mo,date,year,time,zone,...rest] = new Date(1951,6,30).toString().split(' '); console.log('Days-In-Month\t: ',getDaysInMonth(Months.lookFor(mo),year)); console.log('Day-Of-Year\t: ',getDayOfYear(year,Months.lookFor(mo),date)); console.log('Long month\t: ',Months[Months.lookFor(mo)]); console.log('Long day\t: ',Days[Days.lookFor(day)]); var today = new Date(), Kbday = new Date(1951,6,30), daysbetween = today.dayDiff(Kbday); console.log('days between\t: ', daysbetween, 'days or', (daysbetween/365).toFixed(2), 'years');</script></body></html>
  14. This might be a little easier to understand. See links internal to code or https://htmldog.com/techniques/pullquotes/. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Pull quotes 1</title> <!-- 2 Examples of PullQuote displays From: https://htmldog.com/techniques/pullquotes/ --> <!-- // style> body { font: 13px/1.5 arial, helvetica, sans-serif; } article { width: 500px; } .pquote { float: left; /* or right; */ width: 100px; background: #ddf; font-weight: bold; padding: 13px; margin: 0 13px 13px 0; } blockquote { margin: 0; } </style --> <style> body { font: 13px/1.5 arial, helvetica, sans-serif; } article { width: 500px; } .pquote { float: left; width: 200px; background: url(/examples/images/openquote.gif) top left no-repeat; color: #030; font-size: 26px; line-height: 0.9; font-style: italic; padding: 13px; } blockquote { margin: 0; } .pquote p:first-letter { font-size: 39px; font-weight: bold; } </style> </head> <body> <article> <p>If ever there was evidence of God, the humble pea is it.</p> <p>Mother Nature has never created something of such perfection, something that takes Darwin's theory of evolution to the extent that a natural element can, over millions of years, evolve into something so flawless.</p> <aside class="pquote"> <blockquote> <p>It is not an exaggeration to say that peas can be described as nothing less than perfect spheres of joy.</p> </blockquote> </aside> <p>The green seed of the white-flowering climbing leguminous papilionaceous plant, pisum sativum, has become a dining-table favourite for good reason.</p> <p>The perfect accompaniment to any meal, the diminutive spherical vegetable brings joy to billions worldwide, be they fresh, frozen, canned or dried.</p> <p>Even leaving aside the astounding nutritional package, the taste explosion and texture of a well cooked pea is undeniably enough to award this deceptively simple seed the gold-medal of the foodstuff Olympics.</p> <p>There is debate surrounding the tampering of the form of the original spherical vegetable. The question as to whether the 'mushy' pea is sacrilege or an innovative approach to re-package the perfect product is a sensitive issue. A similar argument arises when approaching the relatively new craze of mangetout. In-depth study is required, but for now it is too early to assess the true importance of this baby pea pod. </p> <p>In its original form, the pea is a giant amongst food products and a deity of the vegetable world. It is not an exaggeration to say that peas can be described as nothing less than perfect spheres of joy.</p> </article> <!-- Link back to HTML Dog: --> <p><a href="http://www.htmldog.com/examples/"><img src="http://www.htmldog.com/badge1.gif" alt="HTML Dog"></a></p> </body> </html>
  15. Can you provide a brief example of your problem that can be viewed without downloading files?
  • Create New...