Front End Technology Articles

Page 491 of 652

Pull down to refresh on the mobile web browser in HTML.

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 24-Jun-2020 975 Views

When there is a requirement to pull down the screen to refresh the page to get latest updates, this can be done with the help of JavaScript, xhttprequests and then touch events.Pull refresh is a trigger to XHR in AJAX .It adds new data to the element we want.Pull refresh can be implemented with the help of hijacked JavaScript scrolling mechanism like iscroll. Twitter is using iscroll to pull refresh option.Another way is to create a refresh handler for overflow:scroll components.The interface provided can give an idea about the handler interface −var PullToRefresh= function(callback, wrapper, instructionsText) {    //It ...

Read More

EventSource vs. wrapped WebSocket with HTML5 Server-Side Event

Chandu yadav
Chandu yadav
Updated on 24-Jun-2020 167 Views

The event source is just a web socket that -That cannot send data Uses text or event stream format It fires events that are server definedIt is useful in applications that only need server push.Web sockets are good for applications that need fast communications in both directions.Another major difference is the different security models they used.Server Send events are useful for −Live Feeds Live Scores Stock Market Update

Read More

Splitting up an HTML page and loading it through header?

seetha
seetha
Updated on 24-Jun-2020 234 Views

In order to speed up creation and edition of HTML, splitting of HTML files are required into three separate HTML files −HeaderFooterContentThis is not possible in a static Html website; however, this is possible through PHP. Another way is to use JavaScript to load page pieces after the main page is already loaded.

Read More

How does mobile safari determine when to prompt the user to share location in HTML?

Samual Sam
Samual Sam
Updated on 24-Jun-2020 159 Views

When we have a requirement in which we want to track the latest locations for a user only when they are in a certain area, then we write separate code for it. The code to determine when to prompt the user to share location in HTML is as follows -if (frstTime) { //First time        navigator.getCurrentPosition(function (coordinates) {             if (coordsAreInTheBox) {                    storeCoordsForUser();                    navigator.watchPosition();             }        }); ...

Read More

Set Button on Image with CSS

Nancy Den
Nancy Den
Updated on 24-Jun-2020 2K+ Views

You can try to run the following code to set button on an image:ExampleLive Demo                    .box {             position: relative;             width: 100%;             max-width: 250px;          }          .box img {             width: 100%;             height: auto;          }          .box .btn {             position: absolute;             top: 50%;             left: 50%;             transform: translate(-50%, -50%);          }                                        Button          

Read More

Variables in CSS

Chandu yadav
Chandu yadav
Updated on 24-Jun-2020 108 Views

Variables in CSS are used to add custom property values to your web page. Set a custom name of the property and set value for it.You can try to run the following code to implement variables in CSS to change the background and text colorExampleLive Demo                    :root {             --my-bg-color: blue;             --my-color: white;          }          #demo {             background-color: var(--my-bg-color);             color: var(--my-color);          }                     Heading One       This is demo text. This is demo text. This is demo text.          This is demo text. This is demo text. This is demo text. This is demo text.          This is demo text. This is demo text.                

Read More

What are Pure HTML export buttons in jQuery Data Table?

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 24-Jun-2020 218 Views

jQuery Data Table provides export buttons with the help of which we can make a structure like the following −Export PDFExport CSVExport HTMLExport ExcelFor this, we need to write code −var tbl = $('#extable').DataTable({      dom: 'export',        buttons: [          {                 extend: 'collection',                 text: 'Export',                 buttons: [ 'csvHtml5', ' pdfHtml5', 'copyHtml5', 'excelHtml5' ]          }        ] });

Read More

Solve unknown gap between elements in Flexbox with HTML5.

Arjun Thakur
Arjun Thakur
Updated on 24-Jun-2020 264 Views

Unknown gaps between elements in flexbox are due to margin collapsing of the header to the bar division. To resolve this −Either Margin is reset to 0 for header or Border is added to the bar.Padding can be done to bar by adding property padding: 10px to bar. Try the following code snippet to resolve the unknown gap problem −.bar {    background: yellow;    color: gray;    height: 250px;    padding: 10px;    text-align: center; }

Read More

Applying a CSS style to an ID element when the beginning of its name stays identical and the end varies in HTML

Ankith Reddy
Ankith Reddy
Updated on 24-Jun-2020 99 Views

Posts can be selected using div with ‘id=post’. This will select all div elements with an id which contains a value in quotes.We can use either −div[id*='post-'] { ... } or div[id^='post-'] { ... }.div[id*='post-'] { ... } will select all div elements with id which is having all values in quotes.Or we can use,div[id^='post-'] { ... }This will select all div elements with an id which started with quotes.

Read More

Shorthand property to set columns with CSS

Daniol Thomas
Daniol Thomas
Updated on 24-Jun-2020 194 Views

Use the columns property to set columns with CSS. You can try to run the following code to implement the columns property:ExampleLive Demo                    .demo {             column-rule-color: gray;             columns: 100px 4;             column-rule-style: dashed;          }                              This is demo text. This is demo text. This is demo text. This is demo text.         ...

Read More
Showing 4901–4910 of 6,517 articles
« Prev 1 489 490 491 492 493 652 Next »
Advertisements