mardi 27 juillet 2021

Why does offsetWidth show incorrect value?

I wrote this code:

<!DOCTYPE html>
<html>
<head></head>
<body>

<script>
  let html = document.documentElement
  console.log(window.innerWidth) // 420
  console.log(html.clientWidth) // 420
  console.log(html.offsetWidth) // 420

  html.style.overflowY = 'scroll' // add scroll-bar
  console.log('Window: ' + window.innerWidth) // Window: 420
  console.log('clientWidth: ' + html.clientWidth) // clientWidth: 403
  console.log('offsetWidth: ' + html.offsetWidth) // offsetWidth: 403 (*)
</script>
</body>
</html>

When I added scroll-bar, I got 403 as clientWidth, and this seems like true: 403px for inner content + 17px for scroll-bar. And then I got 403 as offsetWidth, but offsetWidth must include scroll-bar width. Therefore I should get 420, not 403.

Why do I get 403 as result in (*)?




Flutter Web: Right click -> Browser Context Menu -> Open Link in New Tab

I have a basic website using GetX for navigation. I have inkwells with ontap functions which navigate to a new view. Right now, if you right click these buttons there is no "open link in new tab/window", "save link as" or "copy link address".

Is there any way to get this functionality for Flutter Web?




Can any one help me out with in publishing my website? [closed]

Here is the website link chay.tech It's opening when i click it, but i am shown a warning in github, please help me in resolving itenter image description here




Page on website not opening properly on phones

One page on my website – https://travellingthroughwords.com/index.php/proofreading-editing-service/ is loading properly on PCs but not on phone. This is the only page that is giving a problem. The others are opening properly on phone. Please help!




Introducing a new change in website caused reduced traffic

On our website we introduced new changes as the following scenario:

Before: Enter zip code in Homepage ---> locations page

Now: Enter zip code in Homepage ---> shop page

Now, SEO has mentioned that visitors reaching shop pages after zip-in has dropped.

Wondering what the reason could be. Every time I test the zip-in functionality, it works fine and takes to the shop page as expected (no errors).

Any insights or suggestions from an SEO perspective would be highly appreciated. Thank you!




what is causing this endforeach error when I try to upgrade the site to PHP 7.4?

Hey This code of mine is causing a total crash on my website:

<select size="1" class="<?php echo $this->level; ?> mobilenav" onchange="document.location.href = '/'+this.value">

<?
if(/*$this->level == "level_1"*/ false) {
?>
    <option value="">Navigation...</option>
<?php foreach ($this->items as $item): 
  
    $classes = explode(" ",$item["class"]); 

    ?>

      <optgroup label="<?= $item["link"] ?>">
          <?= $item["subitems"] ?>
      </optgroup>
  <?php endforeach; ?>
<?
} else {
    foreach ($this->items as $item):

        $classes = explode(" ",$item["class"]);

        ?>
        <?php if ($item['isActive'] || in_array("trail",$classes)): ?>
        <option class="<?php echo $item['class']; ?>" selected="selected"><span class="<?php echo $item['class']; ?>"><?php echo $item['link']; ?></span></option>
    <?php else: ?>
        <option<?php if ($item['class']): ?> class="<?php echo $item['class']; ?>"<?php endif; ?> value="<?php echo $item['href']; ?>"><?php echo $item['link']; ?></option>
    <?php endif; ?>
    <?php endforeach;
}?>
</select>

Story: im Upgrading an old Website of mine currently to be able to use it with the newest version of PHP.

This is the error im getting:

[2021-07-27 08:08:38] request.CRITICAL: Uncaught PHP Exception ParseError: "syntax error, unexpected 'endforeach' (T_ENDFOREACH), expecting end of file" at /var/www/vhosts/web/templates/nav_dropdown.html5 line 20 {"exception":"[object] (ParseError(code: 0): syntax error, unexpected 'endforeach' (T_ENDFOREACH), expecting end of file at /var/www/vhosts/web/templates/nav_dropdown.html5:20)"} []

I dont get why it is expecting the code to end at line 20, maybe someone has a fast answer for me? thanks in advance. Hans.




Why are my images not centering using auto left and right margins in inline block display?

using inline block and margin-left auto and margin-right auto the image doesnt center