L
L
Lyuba2018-06-09 14:11:56
AJAX
Lyuba, 2018-06-09 14:11:56

Ajax full screen window?

Tell me how to make an Ajax window full screen like here volganin.net/items/doska_obreznaja_estestvennoj_vl... you need to click on the photo enlargement.
This is how I made the button.

<? if($img_zoom) echo '<a id="new_url" class="example1" href="'.$new_url.'">'.$img_zoom.'</a>'; ?>

I wrote this in the fancy.js file
$(".example1").fancybox({ 
padding : 0, 
margin : 0, 
scrolling : 'no',	// 'auto', 'yes' or 'no' 
width	: 1280, 
height	: 1024, 
type	: 'iframe' 
});

but outside the window there is still scrolling at the top and bottom + the photo does not move much to the right
5b1bb5ce2f6bd550980333.png5b1bb5d51d3d7097488899.png
here is the file itself
<?
$base_path = '../';
$bp = '../';
require_once($base_path.'connect/connect.php');
include_once($base_path.'lib/lib.php');

$id = intval($_GET['id']);
$id_f = intval($_GET['id_f']);

$r=mysql_query("SELECT * FROM board WHERE id='".$id."'");
$rr=mysql_fetch_array($r);


$rf = mysql_query ("SELECT * FROM foto WHERE id = '".$id."' ORDER BY id_foto") or die(mysql_error());
$i=0;

$pf='foto';
while($rrf = mysql_fetch_assoc($rf))
  {
  if(file_exists($bp.$pf.'/'.$rrf['papka'].'/'.$rrf['id_foto'].'s.jpg') 
  && file_exists($bp.$pf.'/'.$rrf['papka'].'/'.$rrf['id_foto'].'b.jpg'))
    {
    $am[$i][0]=$bp.$pf.'/'.$rrf['papka'].'/'.$rrf['id_foto'].'b.jpg';
    $am[$i][1]=$bp.$pf.'/'.$rrf['papka'].'/'.$rrf['id_foto'].'s.jpg';
    $i++;

    }
  }
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Фото</title>
<link rel="shortcut icon" href="<?=$abs_base_file?>icon/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="<?=$abs_base_file?>style/style.css" />
<link rel="shortcut icon" href="<?=$bp?>icon/favicon.ico" type="image/x-icon">



<script type="text/javascript" src="<?=$bp.'js/'?>jquery-3.3.1.js"></script>

</head>

<div class="">


<?

$rez=count($am);
if($rez>0)
{

  if($rez>1)
  {
  ?>
  
      <script language="JavaScript">

      var imgArr = new Array();
      var k=0;

      var Foto = new Array();

      <?
      $i=0;
      foreach ($am as $ams)
        {
    			echo("\n Foto[".$i."] = '".$ams[0]."';");
        $i++;
        }
      ?>
      
      
      function toTek(j) {
        	eval("imgObj" + j + "= new Image()");
        	eval("imgObj" + j + ".src = '" + Foto[j] + "'");
 			eval("document.vvr.src = imgObj"+j+".src");
      k=j;
      }

      function toTekd() {
      k=k+1;
      if(!Foto[k]) k=0;
        	eval("imgObj" + k + "= new Image()");
        	eval("imgObj" + k + ".src = '" + Foto[k] + "'");
 			eval("document.vvr.src = imgObj"+k+".src");
      }

      </script>
  
  
<table width="100%"><tr>
  <td width=100%>
  <div align="center">
  <?
  foreach($am as $index=>$aa)
    {
    ?>
    <a onclick="toTek(<?=$index?>)"><img height="70" border=0 class="imground" src="<?=$aa[1]?>" /></a>
    <?
    }
    ?>
  </div>
  <br>
  <center><a onclick="toTekd()"><img name="vvr" alt="<?=$rr['zag'].'. '.$name_region?>" class="imground" border=0 src="<?=$am[0][0]?>"></a></center>
  </tr></table>
  <?
  }
else echo '<center><img alt="'.$rr['zag'].'. '.$name_region.'" class="imground" border=0 src="'.$am[0][0].'"></center>';
}
?>
</div>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2018-06-09
@Stalker_RED

fancybox3 has hideScrollbar and compensate-for-scrollbar options . But you have version 2.1.5 there, which is already five years old. What is surprising, despite the fact that the version of jquery is fresh.
And in general, free advice from the Internet: Lyuba - run away from this project. I am impressed by php code with noodles, raw mysql_query and eval.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question