A
A
Aleksandr2015-06-23 11:39:20
PHP
Aleksandr, 2015-06-23 11:39:20

How to stretch img to full screen using js?

you need to stretch the image ( ) to fill the screen using js, while maintaining proportions. How can this be implemented? <img src..

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Shamanov, 2018-10-02
@SilenceOfWinter

Recursive export use something like this:

public static function dirs($code, $data) {
    $pattern = '/\[\[\s*@([^\(]+)\(([^\)]+)\)\s*\]\]([^\[]+)\[\[\s*@([^\(]+)\(#end\)\s*\]\]/i';
    return preg_replace_callback($pattern, function($value) use($data) {
      if($value[1] == 'times') {
           if (!empty($value[3])) {
                  $value[3] = self::dirs($value[3], $data);
           }
           return str_repeat($value[3], $value[2]);
}
    }, $expression);
  }

N
Nikita Borzenkov, 2015-06-23
@Sashjkeee

$('img').css({'width': $(window).width(), 'height': 'auto'});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question