Jump to content

ben03

Members
  • Content Count

    109
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ben03

  • Rank
    Member

Contact Methods

  • Website URL
    www.designsbyben.co.uk
  • ICQ
    0

Profile Information

  • Interests
    Digital design
  1. I have a load of data coming from the database, of which I have not control of. When it comes in I am putting it in an html table. I have set up a basic if statement: If it is a blank field, show 'NA'. If not, show the figures in an input that a user can edit. The trouble I am running into is if a user backspaces the characters in the input, it then of course beomes the static text 'NA', but I need it to remain an input! What can I do in this scenario to prevent this from happening? I am using Vue.js, below is what I am using: <div v-if="item.value === ''"> NA </div> <div v-else> <input class="input is-small" v-model="item.value"> </div>
  2. Hi there, I am new to Javascript, and finding displaying date and time confusing. I am using new Date().toLocaleString() ...which is perfect, however I am trying to remove seconds on the end as these are not relevant. How do I achieve this? Thanks
  3. ben03

    vh + rem

    Hi there, I am hoping to create a container that starts part way down a page, and fills out the majority of space below it (minus some padding before the footer). I wrote the following: min-height: calc(100vh - 15.44rem); The rem size is the 247 pixels above and below that it isn't to fill out. This works, until the base font size is increased. Is there a solution to keeping this the correct min height? I could have just written the px value, but the elements above are rem sized as well so these will push the container down when the base font size is increased. Hope that makes sense? Thanks
  4. Thanks for this, I found adding the width directly to the cell class caused cell height to play up sometimes though. Is there any way of telling a cell to collapse around an element with a fixed width inside it or does this sort of thing not exist? thanks
  5. Thanks dsoneuk, I tried changing the span a div but am getting the same results?
  6. Hi there, I have been trying set a width of the last column in a table to 200px. <div class="table"> <div class="table-row"> <div class="table-cell">data</div> <div class="table-cell">data</div> <div class="table-cell"><span>data</span></div> </div> </div> .table{display: table;} .table-row{display: table-row;} .table-cell{display: table-cell;} .table-cell span{width: 200px;} Setting .table-cell:last-child to 200px causes strange behaviour with the height of the cells (this matters as a certain row is highlighted). Setting a width on the span solves the cell height issue, but the table still distributes the available space to each column evenly, so the last column is its natural width, plus 200px making it pretty wide. Is there a way to stop this last column filling out and remaining at 200px? Thanks.
  7. I did not realise that. Sorted. Thank you dsonesuk!
  8. Hi, Can you use 'a' and 'a :focus' as conditional to hide/show another element? The following doesn't seem to work. Is it likely to with some re-working, or is this a no-no? a + span{display: none;} a:focus + span{display: block;} <a>Anchor</a><span><input /></span> Thanks
  9. I was wondering if there was a CSS property and value that could be given to containing divs to keep them expanding with the content that I didn't know about. The problem I am experiencing is when a div has overflow-x set to visible, the overflowing content is visible, but the background cuts off at the point where you start scrolling. display:inline-block; seemed to solve it when given to the container, but then caused errors for the table it contained which stayed collapsed at its minimum width as opposed to filling the space when div was expanded (the div in question is a re-sizeable draggable pane). Is there a way of solving this I am unaware of? Help much appreciated.
  10. Thanks for the pointers, much appreciated
  11. I was wondering whether it was possible to set a horizontal scrollbar to automatically scroll the furthest right upon opening, or whether this is something that has to be manipulated by jquery?
  12. This is helpful and makes sense, thanks also for sharing the link!
  13. li{height: 48px; overflow: hidden; -webkit-transition: 0.3s; transition: 0.3s; -moz-transition: 0.3s; -ms-transition: 0.3s; -o-transition: 0.3s;} li.tree-is-expanded{height: 100%;} This would essentially hide the nested ul until the class '.tree-is-expanded' is added. But the transition jumps as opposed to shows the transition. I have also tried targeting the nested ul but this doesn't work either: li ul{height: 48px; overflow: hidden; -webkit-transition: 0.3s; transition: 0.3s; -moz-transition: 0.3s; -ms-transition: 0.3s; -o-transition: 0.3s;} li.tree-is-expanded ul{height: 100%;} Thanks
  14. Hi there, I am working on a tree structure using lists. When you click on a button in a list item, it opens a sublist up. When a sub-list is opened, the tree below moves down, and up if closed. It does this with a jolt, and am I hoping there is a way to animate this smoothly? The problem I am having is that all tutorials I have found use a hard-coded max-height to animate from and to. I cannot do this as the list has to be able to be any size. Also the structure is dynamically generated which also makes it quite hard to append classes to certain points. Is there a way to do achieve a smooth height transition in this scenario? Thanks
×
×
  • Create New...